codetools: find declaration: added robust check

git-svn-id: trunk@22467 -
This commit is contained in:
mattias 2009-11-07 10:40:17 +00:00
parent 9e7750c617
commit e19baa54d3

View File

@ -1431,9 +1431,10 @@ begin
Result:=(fsfIncludeDirective in SearchSmartFlags);
exit;
end;
if CursorNode=nil then
if CursorNode=nil then begin
// raise exception
FindDeepestNodeAtPos(CleanCursorPos,true);
CursorNode:=FindDeepestNodeAtPos(CleanCursorPos,true);
end;
{$IFDEF CTDEBUG}
DebugLn('TFindDeclarationTool.FindDeclaration D CursorNode=',NodeDescriptionAsString(CursorNode.Desc),' HasChilds=',dbgs(CursorNode.FirstChild<>nil));
{$ENDIF}