]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fix NPE in case there are no extension attachments and the area tree was built from...
authorJeremias Maerki <jeremias@apache.org>
Tue, 27 Jun 2006 18:16:31 +0000 (18:16 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 27 Jun 2006 18:16:31 +0000 (18:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@417542 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/area/PageViewport.java

index e2986855ace5b903067aa04c7a0e7acf9778f19c..e4be2d8e2f49974e727f323276c53e0b008e8200 100644 (file)
@@ -23,6 +23,7 @@ import java.awt.geom.Rectangle2D;
 import java.io.ObjectOutputStream;
 import java.io.ObjectInputStream;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
@@ -563,7 +564,11 @@ public class PageViewport extends AreaTreeObject implements Resolvable, Cloneabl
     
     /** @return the list of extension attachments for this page */
     public List getExtensionAttachments() {
-        return this.extensionAttachments;
+        if (this.extensionAttachments == null) {
+            return Collections.EMPTY_LIST;
+        } else {
+            return this.extensionAttachments;
+        }
     }
     
     /** @return True if this is a blank page. */