Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: JiBX 1.2.3
-
Fix Version/s: None
-
Component/s: core
-
Labels:None
-
Number of attachments :
Description
Utility.serializeDateTime() throws a NullPointerException when trying to serialize a null Date (an Object's property of Date type that hasn't been initialized for whatever reason).
Current code:
1441 public static String serializeDateTime(Date date)
{ 1442 return serializeDateTime(date.getTime(), true); 1443 }So if for some reason date is null, line 1442 would throw a java.lang.NullPointerException. It should include the null check and return null or an empty string. For example:
public static String serializeDateTime(Date date) {
if(date == null)
return serializeDateTime(date.getTime(), true);
}
Regards,
Sergio
Current code with proper format (without line numbers):