apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Uploading Image Results in NullPointerException

Open neeldoshii opened this issue 1 year ago • 4 comments
trafficstars

Description

Still trying to find root cause what's causing the bug. Uploading image result in Null Pointer Exception.

Video

https://github.com/commons-app/apps-android-commons/assets/60827173/330c63c7-57fe-454f-bc9c-4dc3816868e1

Tested on 4.2.1 proddebug, prodrelease, betadebug

Debug Logs

2024-03-04 21:13:45.994 18962-18962 ImageProcessingService  fr.free.nrw.commons                  D  Checking for image title [UploadMediaDetail(languageCode=en, descriptionText=test description, captionText=test)]
2024-03-04 21:13:46.007 18962-19053 okhttp.OkHttpClient     fr.free.nrw.commons                  I  --> GET https://commons.wikimedia.org/w/api.php?action=query&format=json&formatversion=2&titles=File%3Atest.jpg
2024-03-04 21:13:46.008 18962-19023 okhttp.OkHttpClient     fr.free.nrw.commons                  I  --> GET https://commons.wikimedia.org/w/api.php?action=query&format=json&formatversion=2&list=allimages&aisha1=53d83cd0fb79fdbd794ce1a0062bf7d83423d91d
2024-03-04 21:13:46.340 18962-19053 okhttp.OkHttpClient     fr.free.nrw.commons                  I  <-- 200 https://commons.wikimedia.org/w/api



2024-03-04 21:13:46.367 18962-18962 UploadMediaPresenter    fr.free.nrw.commons                  E  Error occurred while handling image
                                                                                                    java.lang.NullPointerException
                                                                                                    	at fr.free.nrw.commons.media.MediaClient$checkPageExistsUsingTitle$1.invoke(MediaClient.kt:43)
                                                                                                    	at fr.free.nrw.commons.media.MediaClient$checkPageExistsUsingTitle$1.invoke(MediaClient.kt:43)
                                                                                                    	at fr.free.nrw.commons.media.MediaClient.checkPageExistsUsingTitle$lambda$1(MediaClient.kt:43)
                                                                                                    	at fr.free.nrw.commons.media.MediaClient.$r8$lambda$n1PmiKdGdMC1iyksqdeANSWbYnw(MediaClient.kt:0)
                                                                                                    	at fr.free.nrw.commons.media.MediaClient$$ExternalSyntheticLambda6.apply(R8$$SyntheticClass:0)
                                                                                                    	at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(SingleMap.java:57)
                                                                                                    	at io.reactivex.internal.operators.observable.ObservableSingleSingle$SingleElementObserver.onComplete(ObservableSingleSingle.java:109)
                                                                                                    	at retrofit2.adapter.rxjava2.BodyObservable$BodyObserver.onComplete(BodyObservable.java:66)
                                                                                                    	at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:51)
                                                                                                    	at io.reactivex.Observable.subscribe(Observable.java:12267)
                                                                                                    	at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34)
                                                                                                    	at io.reactivex.Observable.subscribe(Observable.java:12267)
                                                                                                    	at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:35)
                                                                                                    	at io.reactivex.Single.subscribe(Single.java:3603)
                                                                                                    	at io.reactivex.internal.operators.single.SingleMap.subscribeActual(SingleMap.java:34)
                                                                                                    	at io.reactivex.Single.subscribe(Single.java:3603)
                                                                                                    	at io.reactivex.internal.operators.single.SingleMap.subscribeActual(SingleMap.java:34)
                                                                                                    	at io.reactivex.Single.subscribe(Single.java:3603)
                                                                                                    	at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
                                                                                                    	at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
                                                                                                    	at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
                                                                                                    	at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
                                                                                                    	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                                                                                                    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
                                                                                                    	

Would you like to work on the issue?

Yes

neeldoshii avatar Mar 04 '24 15:03 neeldoshii

@neeldoshii I am unable to reproduce this issue on the main branch, did you take a pull from the current main?

shashankiitbhu avatar Mar 04 '24 16:03 shashankiitbhu

I can successfully upload an Image on main

shashankiitbhu avatar Mar 04 '24 16:03 shashankiitbhu

@neeldoshii I am unable to reproduce this issue on the main branch, did you take a pull from the current main?

On main branch only. Not sure why it lead me on only two images. Will try to figure it out root cause.

neeldoshii avatar Mar 04 '24 16:03 neeldoshii

@neeldoshii can you try again with the same images? also let me know if you need any help

shashankiitbhu avatar Mar 04 '24 17:03 shashankiitbhu