You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Wayne Chan (JIRA)" <ji...@apache.org> on 2013/08/06 23:44:48 UTC

[jira] [Updated] (PDFBOX-1412) NullPointerException when getting fields from a PDF file

     [ https://issues.apache.org/jira/browse/PDFBOX-1412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wayne Chan updated PDFBOX-1412:
-------------------------------

             Priority: Critical  (was: Major)
    Affects Version/s: 1.8.2
    
> NullPointerException when getting fields from a PDF file
> --------------------------------------------------------
>
>                 Key: PDFBOX-1412
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1412
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel.AcroForm
>    Affects Versions: 1.7.1, 1.8.2
>         Environment: I encountered this problem while running Junit tests in Netbeans on my dev machine and while running web apps in Tomcat7 on Ubuntu 11.10.
>            Reporter: Wayne Chan
>            Assignee: Andreas Lehmkühler
>            Priority: Critical
>             Fix For: 1.8.0
>
>         Attachments: ICSForms201.pdf
>
>
> I am getting a NullPointerException thrown from PDField.java line 540. The problem is that the code calls COSArray.getObject(i) on line 539, which can return a NULL. Line 540 uses the returned value without first checking for NULL, thus throwing NPE when the value is NULL. The following is the stack trace:
> java.lang.NullPointerException
> 	at org.apache.pdfbox.pdmodel.interactive.form.PDField.getKids(PDField.java:540)
> 	at org.apache.pdfbox.pdmodel.interactive.form.PDFieldFactory.isButton(PDFieldFactory.java:159)
> 	at org.apache.pdfbox.pdmodel.interactive.form.PDFieldFactory.createField(PDFieldFactory.java:68)
> 	at org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.getFields(PDAcroForm.java:203)
> 	...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira