You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ParseEncoder encodes (null) => JSONObject.NULL. But ParseDecoder was not
doing the inverse conversion.
That resulted in JSONObject.NULL values being in the ParseObject.State map,
which means any calls to State.get(key) that were casting the result to a
specific type (i.e., String) without first checking the Object return type
would result in a ClassCastException.
ParseObject already accounts for this possibility by checking the Object type
before casting it, and returning null if the type did not match.
The known case that causes crashes is #209, where ParseUser.State.sessionToken()
casts the result of get(KEY_SESSION_TOKEN) to String. When that was null it
would be encoded as JSONObject.NULL due to the ParseEncoder; but after decoding
it would not convert back to a native null, leading to the ClassCastException.
0 commit comments