1

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");
 }
2
  • post your json string Commented Jul 8, 2014 at 2:25
  • Is 'profile' a column of type 'object' in the table? Commented Jul 8, 2014 at 10:34

1 Answer 1

2

I solved the problem by using

JSONObject profile = currentUser.getJSONObject("profile");

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.