Open GoogleCodeExporter opened 9 years ago
[deleted comment]
I suggest a patch to solve this problem :
In Serializer class, in the serializeToJson(Object pojo):JSONValue method, if
you add a condition to test the null value, you resolve the problem.
public JSONValue serializeToJson(Object pojo) {
// 2011/11/23 : Fabien PERIE
// Patch to resolve a NullPointerException is thrown when 'getTypeName' method for the "Child"
// object is accessed.
if (pojo == null)
{
return JSONNull.getInstance();
}
String name = getTypeName(pojo);
ObjectSerializer serializer = getObjectSerializer(name);
if (serializer == null) {
throw new SerializationException("Can't find object serializer for " + name);
}
return serializer.serializeToJson(pojo);
}
Original comment by fabien.p...@gmail.com
on 24 Nov 2011 at 1:04
Attachments:
Original issue reported on code.google.com by
fra...@gmail.com
on 11 Sep 2011 at 2:02