pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1823370 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
Date Tue, 06 Feb 2018 17:53:56 GMT
Author: tilman
Date: Tue Feb  6 17:53:56 2018
New Revision: 1823370

URL: http://svn.apache.org/viewvc?rev=1823370&view=rev
Log:
PDFBOX-4084: avoid ClassCastException

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java?rev=1823370&r1=1823369&r2=1823370&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java Tue Feb
 6 17:53:56 2018
@@ -200,13 +200,12 @@ public class PDPage implements COSObject
     {
         if (pageResources == null)
         {
-            COSDictionary resources = (COSDictionary)
-                    PDPageTree.getInheritableAttribute(page, COSName.RESOURCES);
+            COSBase base = PDPageTree.getInheritableAttribute(page, COSName.RESOURCES);
 
             // note: it's an error for resources to not be present
-            if (resources != null)
+            if (base instanceof COSDictionary)
             {
-                pageResources = new PDResources(resources, resourceCache);
+                pageResources = new PDResources((COSDictionary) base, resourceCache);
             }
         }
         return pageResources;



Mime
View raw message