adsdroid icon indicating copy to clipboard operation
adsdroid copied to clipboard

App triggers NullPointerExpcetions and crashes

Open Marukohe opened this issue 2 years ago • 0 comments

App will crash due to some concurrency bugs.

Trace

// CRASH: hu.vsza.adsdroid (pid 6126)
// Short Msg: java.lang.NullPointerException
// Long Msg: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ProgressDialog.dismiss()' on a null object reference
// Build Label: google/sdk_gphone_x86_arm/generic_x86_arm:9/PSR1.180720.122/6736742:userdebug/dev-keys
// Build Changelist: 6736742
// Build Time: 1596587219000
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ProgressDialog.dismiss()' on a null object reference
 	at hu.vsza.adsdroid.c.a(Unknown Source:8)
 	at hu.vsza.adsdroid.c.onPostExecute(Unknown Source:2)
 	at android.os.AsyncTask.finish(AsyncTask.java:695)
 	at android.os.AsyncTask.access$600(AsyncTask.java:180)
 	at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
 	at android.os.Handler.dispatchMessage(Handler.java:106)
 	at android.os.Looper.loop(Looper.java:193)
 	at android.app.ActivityThread.main(ActivityThread.java:6669)
 	at java.lang.reflect.Method.invoke(Native Method)
 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Reason

SearchPanel class will post some AsyncTasks. If the first task invoke its onPostExecute() method, the field mProgressDialog will be set to null. At the same time, the second task uses this field, and NPE is triggered.

Marukohe avatar Apr 12 '23 14:04 Marukohe