From e5dfdae116345f9b6ef74db6f56f2a330d238ed1 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Fri, 27 Jun 2014 21:40:32 +0200 Subject: [PATCH] Fix ArgumentOutOfRangeException when double-clicking at text offset 0 in the DebuggeeExceptionForm. --- .../Debugger.AddIn/Service/DebuggeeExceptionForm.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs index 87aad31e06..719292fc05 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs @@ -104,9 +104,11 @@ namespace ICSharpCode.SharpDevelop.Services return; int start = index; // find start of current line - while (--start > 0 && fullText[start - 1] != '\n'); + while (start > 0 && fullText[start - 1] != '\n') + start--; // find end of current line - while (++index < fullText.Length && fullText[index] != '\n'); + while (index < fullText.Length && fullText[index] != '\n') + index++; string textLine = fullText.Substring(start, index - start);