Browse Source

* Generate error-message if WriteContent returns nil

git-svn-id: trunk@8035 -
joost 18 years ago
parent
commit
4a649f5b74
1 changed files with 3 additions and 0 deletions
  1. 3 0
      packages/fcl-web/src/fphtml.pp

+ 3 - 0
packages/fcl-web/src/fphtml.pp

@@ -192,6 +192,7 @@ Uses dbugintf;
 
 resourcestring
   SErrRequestNotHandled = 'Web request was not handled by actions.';
+  SErrNoContentProduced = 'The content producer "%s" didn''t produce any content.';
 
 { THTMLContentProducer }
 
@@ -225,6 +226,8 @@ begin
     try
       FWriter.CurrentElement := ParentElement;
       el := WriteContent (FWriter);
+      if not assigned(el) then
+        Raise EHTMLError.CreateFmt(SErrNoContentProduced,[Self.Name]);
       result := el.asstring;
     finally
       if WCreated then