From e19baa54d36b179f7bf75d443a7e3749c78dfa2c Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 7 Nov 2009 10:40:17 +0000 Subject: [PATCH] codetools: find declaration: added robust check git-svn-id: trunk@22467 - --- components/codetools/finddeclarationtool.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index b49824a534..c1f08450e3 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -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}