gkopff/gson-jodatime-serialisers

Crashes on JsonNull object

Closed this issue · 2 comments

Throws exception here:
java.lang.UnsupportedOperationException: JsonObject at com.google.gson.JsonElement.getAsString
`// Do not try to deserialize null or empty values

    if json.getAsString() == null || json.getAsString().isEmpty()) {
        return null;

}`
it is because json.getAsString() throws it but json.toString() works good
here is stackoverflow question https://stackoverflow.com/a/9324906/1307690

That was my mistake, I tried to deserialize data that was serialized there by default Gson serializer with gson-jodatime-serialisers and instead of JsonObject there was a JsonArray