Summary:
DeleteTask (An Async task) is invoked onSuccess of some other RX function, without checking the fragments current state, leading to NullPointerExceptions and possible memory leaks
System logs:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
at fr.free.nrw.commons.delete.DeleteTask.onPreExecute(DeleteTask.java:50)
at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:604)
at android.os.AsyncTask.execute(AsyncTask.java:551)
at fr.free.nrw.commons.media.MediaDetailFragment.lambda$onDeleteClicked$2$MediaDetailFragment(MediaDetailFragment.java:428)
at fr.free.nrw.commons.media.MediaDetailFragment$$Lambda$3.accept(Unknown Source)
at io.reactivex.internal.observers.ConsumerSingleObserver.onSuccess(ConsumerSingleObserver.java:63)
at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:81)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:119)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7406)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Device and Android version:
ANDROID_VERSION=6.0.1
BRAND=samsung
PHONE_MODEL=SM-J106H
Commons app version:
APP_VERSION_NAME=2.10.2
Would you like to work on the issue?
Yes
Summary:
DeleteTask (An Async task) is invoked onSuccess of some other RX function, without checking the fragments current state, leading to NullPointerExceptions and possible memory leaks
System logs:
Device and Android version:
ANDROID_VERSION=6.0.1
BRAND=samsung
PHONE_MODEL=SM-J106H
Commons app version:
APP_VERSION_NAME=2.10.2
Would you like to work on the issue?
Yes