title: NullPointerException when ProgressDialog dismiss method is called android
body: <p>I am getting random crash while dismissing progress dialog. My code is:</p>
  
  <pre><code>if(progressdialog != null &amp;&amp; progressdialog.isShowing())
  {
     progressdialog.dismiss();
  }
  </code></pre>
  
  <p>I am getting NullPointerException on progressdialog.dismiss(). How it is possible after passing null check?</p>
  
  <p>Here is crash log</p>
  
  <pre><code>java.lang.NullPointerException
  at com.ebooks.android.Category_Author_Listing$1.handleMessage(Author_Listing.java:1325)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:137)
  at android.app.ActivityThread.main(ActivityThread.java:5103)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:525)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>