Browse Source

* quick fix for uninitialized "CodeEl" usage that trips up small test programs

git-svn-id: trunk@39051 -
marco 7 years ago
parent
commit
f401410500
1 changed files with 10 additions and 6 deletions
  1. 10 6
      utils/fpdoc/dw_html.pp

+ 10 - 6
utils/fpdoc/dw_html.pp

@@ -3169,6 +3169,7 @@ var
 
 begin
   isRecord:=AParent is TPasRecordType;
+  CodeEl:=nil;
   if Members.Count > 0 then
     begin
     wt:=False;
@@ -3290,12 +3291,15 @@ begin
     end;
     CodeEl := CreateCode(CreatePara(CreateTD(CreateTR(TableEl))));
   end;
-  AppendText(CodeEl, ' '); // !!!: Dirty trick, necessary for current XML writer
-  If AddEnd then
-    begin
-    AppendKw(CodeEl, 'end');
-    AppendSym(CodeEl, ';');
-    end;
+  if assigned(CodeEl) Then
+     begin
+        AppendText(CodeEl, ' '); // !!!: Dirty trick, necessary for current XML writer
+        If AddEnd then
+          begin
+          AppendKw(CodeEl, 'end');
+          AppendSym(CodeEl, ';');
+          end;
+     end;
 end;
 
 procedure THTMLWriter.CreateClassPageBody(AClass: TPasClassType;