pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1605956 - in /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form: PDField.java PDRadioCollection.java
Date Fri, 27 Jun 2014 05:37:59 GMT
Author: jahewson
Date: Fri Jun 27 05:37:59 2014
New Revision: 1605956

URL: http://svn.apache.org/r1605956
Log:
PDFBOX-2164: NPE when reading non-terminal fields

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDField.java
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDRadioCollection.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDField.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDField.java?rev=1605956&r1=1605955&r2=1605956&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDField.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDField.java
Fri Jun 27 05:37:59 2014
@@ -528,7 +528,11 @@ public abstract class PDField implements
                 if (kidDictionary.getDictionaryObject(COSName.FT) != null
                         || (parent != null && parent.getDictionaryObject(COSName.FT)
!= null))
                 {
-                    kidsList.add(PDFieldFactory.createField(acroForm, kidDictionary));
+                    PDField field = PDFieldFactory.createField(acroForm, kidDictionary);
+                    if (field != null)
+                    {
+                        kidsList.add(field);
+                    }
                 }
                 else if ("Widget".equals(kidDictionary.getNameAsString(COSName.SUBTYPE)))
                 {
@@ -536,8 +540,11 @@ public abstract class PDField implements
                 }
                 else
                 {
-                    //
-                    kidsList.add(PDFieldFactory.createField(acroForm, kidDictionary));
+                    PDField field = PDFieldFactory.createField(acroForm, kidDictionary);
+                    if (field != null)
+                    {
+                        kidsList.add(field);
+                    }
                 }
             }
             retval = new COSArrayList<COSObjectable>(kidsList, kids);

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDRadioCollection.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDRadioCollection.java?rev=1605956&r1=1605955&r2=1605956&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDRadioCollection.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDRadioCollection.java
Fri Jun 27 05:37:59 2014
@@ -155,7 +155,11 @@ public class PDRadioCollection extends P
             List kidsList = new ArrayList();
             for (int i = 0; i < kids.size(); i++)
             {
-                kidsList.add( PDFieldFactory.createField( getAcroForm(), (COSDictionary)kids.getObject(i)
) );
+                PDField field = PDFieldFactory.createField( getAcroForm(), (COSDictionary)kids.getObject(i)
);
+                if( field != null )
+                {
+                    kidsList.add( field );
+                }
             }
             return  new COSArrayList( kidsList, kids );
         }



Mime
View raw message