poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49386] New: Null creation date in PPTX file causes NPE
Date Thu, 03 Jun 2010 22:01:34 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49386

           Summary: Null creation date in PPTX file causes NPE
           Product: POI
           Version: 3.6
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSLF
        AssignedTo: dev@poi.apache.org
        ReportedBy: rick.cameron@businessobjects.com


Created an attachment (id=25525)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25525)
PPTX showing NPE

When Tika tried to read metadata from a PPTX that has a null creation date, an
NPE occurs in PackagePropertiesPart.getDateValue. 

    private String getDateValue(Nullable<Date> d) {
        if (d == null) {
            return "";
        }
        SimpleDateFormat df = new SimpleDateFormat(
                "yyyy-MM-dd'T'HH:mm:ss'Z'");
        return df.format(d.getValue());
    }

Although the code checks whether d is null, it appears that d.getValue()
returns null, and an NPE is thrown in SimpleDateFormat.format:

Caused by: java.lang.NullPointerException
    at java.util.Calendar.setTime(Calendar.java:1075)
    at java.text.SimpleDateFormat.format(SimpleDateFormat.java:876)
    at java.text.SimpleDateFormat.format(SimpleDateFormat.java:869)
    at java.text.DateFormat.format(DateFormat.java:316)
    at
org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart.getDateValue(PackagePropertiesPart.java:587)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message