diff --git a/ide/helpmanager.pas b/ide/helpmanager.pas index d6428bdf09..55b5004498 100644 --- a/ide/helpmanager.pas +++ b/ide/helpmanager.pas @@ -1306,13 +1306,14 @@ begin BaseURL:=''; HTMLHint:=''; Code:=CodeToolBoss.LoadFile(ExpandedFilename,true,false); - if Code=nil then exit(shrHelpNotFound); + if (Code=nil) or (CodePos.Y<1) or (CodePos.Y>Code.LineCount) + or (CodePos.X<1) then + exit(shrHelpNotFound); if CodeHelpBoss.GetHTMLHint(Code,CodePos.X,CodePos.Y, [chhoSmartHint, chhoComplete, chhoComments], BaseURL,HTMLHint,CacheWasUsed)=chprSuccess then exit(shrSuccess); - DebugLn(['TIDEHelpManager.GetHintForSourcePosition not found']); Result:=shrHelpNotFound; end;