]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Avoid NPE if no images are used in the document.
authorJeremias Maerki <jeremias@apache.org>
Fri, 2 Mar 2007 17:51:20 +0000 (17:51 +0000)
committerJeremias Maerki <jeremias@apache.org>
Fri, 2 Mar 2007 17:51:20 +0000 (17:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@513865 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/ps/ResourceHandler.java

index 7d68092bff2de4a333fdb3b879b0ca88ca3a08bc..f187e619a80243c81101fae7aae8178d7994521b 100644 (file)
@@ -179,6 +179,9 @@ public class ResourceHandler implements DSCParserConstants {
 
     private static void registerSuppliedForms(ResourceTracker resTracker, Map formResources)
             throws IOException {
+        if (formResources == null) {
+            return;
+        }
         Iterator iter = formResources.values().iterator();
         while (iter.hasNext()) {
             PSImageFormResource form = (PSImageFormResource)iter.next();
@@ -188,6 +191,9 @@ public class ResourceHandler implements DSCParserConstants {
 
     private static void generateForms(ResourceTracker resTracker, FOUserAgent userAgent, 
             Map formResources, PSGenerator gen) throws IOException {
+        if (formResources == null) {
+            return;
+        }
         Iterator iter = formResources.values().iterator();
         while (iter.hasNext()) {
             PSImageFormResource form = (PSImageFormResource)iter.next();