pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1765854 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java
Date Thu, 20 Oct 2016 18:05:33 GMT
Author: tilman
Date: Thu Oct 20 18:05:33 2016
New Revision: 1765854

URL: http://svn.apache.org/viewvc?rev=1765854&view=rev
Log:
PDFBOX-3534: avoid NPE if AcroForm field's child cosdict is null, as suggested by Tim Allison

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=1765854&r1=1765853&r2=1765854&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
Thu Oct 20 18:05:33 2016
@@ -133,10 +133,14 @@ public class PDNonTerminalField extends
         COSArray kids = (COSArray)getCOSObject().getDictionaryObject(COSName.KIDS);
         for (int i = 0; i < kids.size(); i++)
         {
-            PDField field = PDField.fromDictionary(getAcroForm(), (COSDictionary)kids.getObject(i),
this);
-            if (field != null)
+            COSDictionary cosDict = (COSDictionary)kids.getObject(i);
+            if (cosDict != null)
             {
-                children.add(field);
+                PDField field = PDField.fromDictionary(getAcroForm(), cosDict, this);
+                if (field != null)
+                {
+                    children.add(field);
+                }
             }
         }
         return children;



Mime
View raw message