pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1822538 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java
Date Mon, 29 Jan 2018 17:00:56 GMT
Author: tilman
Date: Mon Jan 29 17:00:56 2018
New Revision: 1822538

URL: http://svn.apache.org/viewvc?rev=1822538&view=rev
Log:
PDFBOX-4071: avoid potential NPE

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java?rev=1822538&r1=1822537&r2=1822538&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java
Mon Jan 29 17:00:56 2018
@@ -590,7 +590,8 @@ public final class PDImageXObject extend
             if (cosBase != null)
             {
                 COSObject indirect = null;
-                if (cosBase instanceof COSObject && resources.getResourceCache()
!= null)
+                if (cosBase instanceof COSObject &&
+                        resources != null && resources.getResourceCache() != null)
                 {
                     // PDFBOX-4022: use the resource cache because several images
                     // might have the same colorspace indirect object.



Mime
View raw message