Hi,
I noticed my app crashing in one specific case, when I pass 'null' value to convertAnother() method.
To explain it:
I override marshal() method in my custom converter and convert all fields of a certain objects. I serialize fields like this:
writer.startNode("myFieldName");
context.convertAnother(myObject);
writer.endNode();
In case myObject is null, the thing crashes in TreeMarshaller.java:48, which is the following line:
converter = converterLookup.lookupConverterForType(item.getClass());
Obviously the 'item' here is null, so calling getClass() on null crashes it. It should first verify if it is null and then use NullConverter. This is a simple fix.
My question is: can I report this as a bug or am I doing something wrong myself?