Handle empty JSON values in Java

210 Views Asked by At

I can't seem to work out how to deal with a null value in a JSON string,

[,63,11303571428571429]

Any attempt to test data.toArray()[0].toString() == null just causes a NullPointerException.

Any clue how to handle this and return a null?

1

There are 1 best solutions below

0
On BEST ANSWER

You can do something like:

data.toArray()[0] == null