diff --git a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs index 7411b20d30..eb8fa5eed5 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs @@ -81,6 +81,8 @@ namespace ICSharpCode.SharpDevelop.Services //string textLine = TextUtilities.GetLineAsString(textEditorControl.Document, line); Point clickPos = exceptionView.PointToClient(Control.MousePosition); int index = exceptionView.GetCharIndexFromPosition(clickPos); + if (index < 0) + return; int start = index; // find start of current line while (--start > 0 && fullText[start - 1] != '\n');