Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-823

NullPointerException in DateConverter.toISO8601(DateConverter.java:221)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.8.3, 2.0.0
    • Component/s: JempBox
    • Labels:
      None
    • Environment:
      JDK 1.6.0_21, Windows XP 32 Bit

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              lehmi Andreas Lehmkühler
              Reporter:
              mhilpert MH
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: