You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2013/11/17 13:05:27 UTC

[jira] [Updated] (PDFBOX-823) NullPointerException in DateConverter.toISO8601(DateConverter.java:221)

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

Andreas Lehmkühler updated PDFBOX-823:
--------------------------------------


Merged into 1.8-branch in revision 1542711

> NullPointerException in DateConverter.toISO8601(DateConverter.java:221)
> -----------------------------------------------------------------------
>
>                 Key: PDFBOX-823
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-823
>             Project: PDFBox
>          Issue Type: Bug
>          Components: JempBox
>    Affects Versions: 1.2.1
>         Environment: JDK 1.6.0_21, Windows XP 32 Bit
>            Reporter: MH
>            Assignee: Andreas Lehmkühler
>             Fix For: 1.8.3, 2.0.0
>
>
> I tried to add metadata as shown in AddMetadataFromDocInfo.java. There's also the line
>    basicSchema.setModifyDate( info.getModificationDate() );
> but I get a NullPointerException at this line:
>     java.lang.NullPointerException
>     	at org.apache.jempbox.impl.DateConverter.toISO8601(DateConverter.java:221)
>     	at org.apache.jempbox.xmp.XMPSchema.setDateProperty(XMPSchema.java:249)
>     	at org.apache.jempbox.xmp.XMPSchemaBasic.setModifyDate(XMPSchemaBasic.java:266)
> because the info.getModificationDate() returns null. It would be better to catch null parameters in the metadata set methods.
> Workaround:
>             if (pddi.getModificationDate() != null) {
>                 basicSchema.setModifyDate(pddi.getModificationDate());
>             }//else: avoid NPE



--
This message was sent by Atlassian JIRA
(v6.1#6144)