]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Give a good message if the Driver isn't initialized.
authorJeremias Maerki <jeremias@apache.org>
Wed, 12 Mar 2003 10:48:04 +0000 (10:48 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 12 Mar 2003 10:48:04 +0000 (10:48 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196075 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/apps/Driver.java

index c8522bc74303fb1a7e9985304e70a98509df79bd..2bcaeb775e3106c685bd5329daa4a4ab1eda92dd 100644 (file)
@@ -552,6 +552,11 @@ public class Driver implements LogEnabled {
      * @return a content handler for handling the SAX events.
      */
     public ContentHandler getContentHandler() {
+        if (treeBuilder == null) {
+            throw new NullPointerException("Driver isn't initialized. "
+                + "You may have to call initialize() first.");
+        }
+        
         // TODO: - do this stuff in a better way
         // PIJ: I guess the structure handler should be created by the renderer.
         if (rendererType == RENDER_MIF) {