diff --git a/ide/main.pp b/ide/main.pp index 50a332f552..213ee5c2de 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -14480,8 +14480,9 @@ begin NewSource,NewX,NewY,NewTopLine) then begin ApplyCodeToolChanges; - DoJumpToCodePos(ActiveSrcEdit, ActiveUnitInfo, - NewSource, NewX, NewY, NewTopLine, true); + if NewSource<>nil then + DoJumpToCodePos(ActiveSrcEdit, ActiveUnitInfo, + NewSource, NewX, NewY, NewTopLine, true); end else begin // error: probably a syntax error or just not in a procedure head/body // or not in a class