title: Weird parse crash android - Attempt to invoke virtual method 'int java.lang.Integer.intValue()
body: <p>So basically I have tried everything but I keep getting this crash. It crashes only sometimes. Here is my code:</p>
  
  <pre><code>if (mCurrentUser != null &amp;&amp; mCurrentUser.containsKey(Constants.TABLE_POINTS)) {
      int points = mCurrentUser.getInt(Constants.TABLE_POINTS) + AppSingleton.sPointsLookupMap.get(pointsKey);
                              mCurrentUser.put(Constants.TABLE_POINTS, points);
                              mCurrentUser.saveInBackground();
  }
  </code></pre>
  
  <p>Stacktrace:</p>
  
  <pre><code>java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
  at com.titlesource.ts_foodsource.fragments.KitchenFragment$10.done(KitchenFragment.java:654)
  at com.titlesource.ts_foodsource.fragments.KitchenFragment$10.done(KitchenFragment.java:649)
  at com.parse.ParseTaskUtils$2$1.run(ParseTaskUtils.java:115)
  at android.os.Handler.handleCallback(Handler.java:746)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at android.os.Looper.loop(Looper.java:148)
  at android.app.ActivityThread.main(ActivityThread.java:5443)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  </code></pre>
  
  <p>Now I found that the intValue() is being used inside the getInt() method (Inside the ParseObject class):</p>
  
  <pre><code> public int getInt(String key) {
          Number number = this.getNumber(key);
          return number == null?0:number.intValue();
      }
  </code></pre>
  
  <p>Why am I getting this exception.
   I have tried everything. Added null checks and also verified that the field is actually present in the mCurrentUser object but all in vain.</p>
  
  <p>If down voting this question, please leave a reason.</p>