Jelajahi Sumber

* makeskel in update mode can crash when looking for elements. Fixed this

git-svn-id: trunk@9592 -
michael 17 tahun lalu
induk
melakukan
e54422ce7a
1 mengubah file dengan 13 tambahan dan 7 penghapusan
  1. 13 7
      utils/fpdoc/dglobals.pp

+ 13 - 7
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;