Reputation: 4560
I've been using Google's Gson API for quite some time and love its simplicity.
Nonetheless, I've found (probably) a bug on the toJson
method.
When I try to convert a null
object to JSON
, instead of an exception, or alternatively a null
String return, I get a String
with the value null
.
Do you consider this a bug?
Upvotes: 0
Views: 1223
Reputation: 5023
null
is not producing NullPointerException
while converting because it is literal and it is valid Gson Value.
Upvotes: 0