title: parse.com java.lang.ClassCastException: java.util.HashMap cannot be cast to org.json.JSONObject
body: <p>My code generally works except sometimes it crashes with the above error. It happens on this line of code...</p>
  
  <pre><code>JSONObject profile = (JSONObject) currentUser.get("profile");
  </code></pre>
  
  <p>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?</p>
  
  <p>Can anyone point me in the right direction?</p>
  
  <pre><code> ParseUser currentUser = ParseUser.getCurrentUser();
  
   if (currentUser.has("profile")) {
              JSONObject profile = (JSONObject) currentUser.get("profile");
   }
  </code></pre>