From e54422ce7a43bf18209405eaf71be432d5be49d7 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 30 Dec 2007 21:17:56 +0000 Subject: [PATCH] * makeskel in update mode can crash when looking for elements. Fixed this git-svn-id: trunk@9592 - --- utils/fpdoc/dglobals.pp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/utils/fpdoc/dglobals.pp b/utils/fpdoc/dglobals.pp index 3f37cbc802..a77afd1326 100644 --- a/utils/fpdoc/dglobals.pp +++ b/utils/fpdoc/dglobals.pp @@ -849,17 +849,23 @@ end; function TFPDocEngine.FindElement(const AName: String): TPasElement; function FindInModule(AModule: TPasModule; const LocalName: String): TPasElement; + var l: TList; i: Integer; + begin - l := AModule.InterfaceSection.Declarations; - for i := 0 to l.Count - 1 do - begin - Result := TPasElement(l[i]); - if CompareText(Result.Name, LocalName) = 0 then - exit; - end; + If assigned(AModule.InterfaceSection) and + Assigned(AModule.InterfaceSection.Declarations) then + begin + l:=AModule.InterfaceSection.Declarations; + for i := 0 to l.Count - 1 do + begin + Result := TPasElement(l[i]); + if CompareText(Result.Name, LocalName) = 0 then + exit; + end; + end; Result := nil; end;