Codetools: Do not crash when invoking ident completion on empty editor. Issue #39685.

This commit is contained in:
Juha 2022-03-29 19:54:01 +03:00
parent 39df877063
commit 9da44c1c9b

View File

@ -2163,7 +2163,7 @@ begin
[btSetIgnoreErrorPos]); [btSetIgnoreErrorPos]);
// Return if CleanCursorPos is before Tree.Root.StartNode. // Return if CleanCursorPos is before Tree.Root.StartNode.
// For example a comment at the beginning of a unit. // For example a comment at the beginning of a unit.
if Tree.Root.StartPos>CleanCursorPos then if (Tree.Root=nil) or (Tree.Root.StartPos>CleanCursorPos) then
Exit; Exit;
if FindDeepestNodeAtPos(CleanCursorPos,false)=nil then if FindDeepestNodeAtPos(CleanCursorPos,false)=nil then
begin begin