pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1844159 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
Date Wed, 17 Oct 2018 20:05:01 GMT
Author: tilman
Date: Wed Oct 17 20:05:01 2018
New Revision: 1844159

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

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java?rev=1844159&r1=1844158&r2=1844159&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java Wed
Oct 17 20:05:01 2018
@@ -2916,12 +2916,11 @@ public class COSParser extends BaseParse
     private void parseDictionaryRecursive(COSObject dictionaryObject) throws IOException
     {
         parseObjectDynamically(dictionaryObject, true);
-        if (dictionaryObject.getObject() == null)
+        if (!(dictionaryObject.getObject() instanceof COSDictionary))
         {
             // we can't be lenient here, this is called by prepareDecryption()
             // to get the encryption directory
-            throw new IOException("Dictionary object " + dictionaryObject +
-                    " is null at offset " + source.getPosition());
+            throw new IOException("Dictionary object expected at offset " + source.getPosition());
         }
         COSDictionary dictionary = (COSDictionary) dictionaryObject.getObject();
         for (COSBase value : dictionary.getValues())



Mime
View raw message