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: [email protected]
ReportedBy: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]