pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1844431 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java
Date Sat, 20 Oct 2018 17:26:55 GMT
Author: tilman
Date: Sat Oct 20 17:26:55 2018
New Revision: 1844431

URL: http://svn.apache.org/viewvc?rev=1844431&view=rev
Log:
PDFBOX-4357: refactor last commit; root is never null

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

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java?rev=1844431&r1=1844430&r2=1844431&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java Sat
Oct 20 17:26:55 2018
@@ -193,12 +193,7 @@ public class PDFParser extends COSParser
         }
         // check pages dictionaries
         checkPages(root);
-        COSBase pages = root.getItem(COSName.PAGES);
-        if (pages instanceof COSObject)
-        {
-            pages = ((COSObject) pages).getObject();
-        }
-        if (pages == null || pages instanceof COSNull)
+        if (root.getDictionaryObject(COSName.PAGES) == null)
         {
             throw new IOException("Page tree root is null");
         }



Mime
View raw message