pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1690216 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/PDXObject.java
Date Fri, 10 Jul 2015 07:34:42 GMT
Author: jahewson
Date: Fri Jul 10 07:34:42 2015
New Revision: 1690216

URL: http://svn.apache.org/r1690216
Log:
PDFBOX-2370: Avoid NPE

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/PDXObject.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/PDXObject.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/PDXObject.java?rev=1690216&r1=1690215&r2=1690216&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/PDXObject.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/PDXObject.java Fri
Jul 10 07:34:42 2015
@@ -21,6 +21,7 @@ import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSStream;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.pdmodel.PDResources;
+import org.apache.pdfbox.pdmodel.ResourceCache;
 import org.apache.pdfbox.pdmodel.common.COSObjectable;
 import org.apache.pdfbox.pdmodel.common.PDStream;
 import org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject;
@@ -67,7 +68,8 @@ public class PDXObject implements COSObj
         }
         else if (COSName.FORM.getName().equals(subtype))
         {
-            return new PDFormXObject(new PDStream(stream), resources.getResourceCache());
+            ResourceCache cache = resources != null ? resources.getResourceCache() : null;
+            return new PDFormXObject(new PDStream(stream), cache);
         }
         else if (COSName.PS.getName().equals(subtype))
         {



Mime
View raw message