pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tboe...@apache.org
Subject svn commit: r1839761 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
Date Fri, 31 Aug 2018 14:52:18 GMT
Author: tboehme
Date: Fri Aug 31 14:52:18 2018
New Revision: 1839761

URL: http://svn.apache.org/viewvc?rev=1839761&view=rev
Log:
PDFBOX-4307: check object type before casting to COSDictionary in PDDocumentCatalog.getDocumentOutline

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

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java?rev=1839761&r1=1839760&r2=1839761&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
Fri Aug 31 14:52:18 2018
@@ -160,8 +160,8 @@ public class PDDocumentCatalog implement
      */
     public PDDocumentOutline getDocumentOutline()
     {
-        COSDictionary dict = (COSDictionary)root.getDictionaryObject(COSName.OUTLINES);
-        return dict == null ? null : new PDDocumentOutline(dict);
+        COSBase cosObj = root.getDictionaryObject(COSName.OUTLINES);
+        return cosObj instanceof COSDictionary ? new PDDocumentOutline((COSDictionary)cosObj)
: null;
     }
 
     /**



Mime
View raw message