My code generally works except sometimes it crashes with the above error. It happens on this line of code...
JSONObject profile = (JSONObject) currentUser.get("profile");
It happens only sometimes when I hit the back button. Which makes it awfully hard for me to understand what is causing the problem. Why would it be a hashmap?
Can anyone point me in the right direction?
ParseUser currentUser = ParseUser.getCurrentUser();
if (currentUser.has("profile")) {
JSONObject profile = (JSONObject) currentUser.get("profile");
}
I solved the problem by using
JSONObject profile = currentUser.getJSONObject("profile");
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments