pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1784639 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java
Date Mon, 27 Feb 2017 19:58:13 GMT
Author: tilman
Date: Mon Feb 27 19:58:13 2017
New Revision: 1784639

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

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java?rev=1784639&r1=1784638&r2=1784639&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java
Mon Feb 27 19:58:13 2017
@@ -133,10 +133,10 @@ public class PDNonTerminalField extends
         COSArray kids = (COSArray)getCOSObject().getDictionaryObject(COSName.KIDS);
         for (int i = 0; i < kids.size(); i++)
         {
-            COSDictionary cosDict = (COSDictionary)kids.getObject(i);
-            if (cosDict != null)
+            COSBase kid = kids.getObject(i);
+            if (kid instanceof COSDictionary)
             {
-                PDField field = PDField.fromDictionary(getAcroForm(), cosDict, this);
+                PDField field = PDField.fromDictionary(getAcroForm(), (COSDictionary) kid,
this);
                 if (field != null)
                 {
                     children.add(field);



Mime
View raw message