null pointer when converting arrays with null

9 views
Skip to first unread message

mtthws

unread,
Aug 10, 2009, 9:16:03 AM8/10/09
to google-gson
Hey,
I am using gson v 1.3. I have an object, lets call it Blarg, that has
an array of objects in it. If I set the array to be of size 1 and
only have a null in it when gson tries to convert it to json it throws
a null pointer exception exception in
JsonTreeNavigator.visitChild line 71
JsonTreeNavigator.navigate line 55
JsonTreeNavigator.visitChild line 85
JsonTreeNavigator.navigate line 55
JsonCompactFormatter.format line 146
Gson.toJson line 275
Gson.toJson line 220
Gson.toJson line 200

public class Blarg{
fields ...

Object[] nullPtrException = {null};

more junk ...
}

inder

unread,
Aug 10, 2009, 1:48:36 PM8/10/09
to google-gson
To reproduce your bug report, I wrote the tests in
http://code.google.com/p/google-gson/source/detail?r=435
However, the tests pass without problem.

Can you check if it is some other error that you might have?
Inder
Reply all
Reply to author
Forward
0 new messages