IDE, SynEdit: fixed a crash/mem-access violation, if restoring a breakpoint to a no longer existing line

git-svn-id: trunk@27892 -
This commit is contained in:
martin 2010-10-27 00:29:44 +00:00
parent a0bf2b0be8
commit bbebbdd3cd

View File

@ -743,7 +743,8 @@ function TIDESynGutterMarks.SourceLineToDebugLine(aLinePos: Integer;
AdjustOnError: Boolean): Integer;
begin
CheckTextBuffer;
if (aLinePos < 1) or (not HasDebugMarks) then exit(aLinePos);
if (aLinePos < 1) or (not HasDebugMarks) or (aLinePos >= FDebugMarkInfo.Count) then
exit(aLinePos);
Result := FDebugMarkInfo[aLinePos - 1];
while (Result = 0) and AdjustOnError and (aLinePos < FDebugMarkInfo.Count-1) do begin
inc(aLinePos);