Skip to content

App crashes while searching images #2711

@ashishkumar468

Description

@ashishkumar468

Summary:
Because of null query(MwQueryResult) or null mwQueryResponse, the app crashes when accessing member variables of these references

System logs:

STACK_TRACE=java.lang.NullPointerException
at fr.free.nrw.commons.mwapi.OkHttpJsonApiClient.lambda$searchImages$5$OkHttpJsonApiClient(OkHttpJsonApiClient.java:245)
at fr.free.nrw.commons.mwapi.OkHttpJsonApiClient$$Lambda$5.call(Unknown Source)
at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44)
at io.reactivex.Single.subscribe(Single.java:3394)
at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:579)
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$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)

Device and Android version:

What make and model device (e.g., Samsung J7) did you encounter this on?
ANDROID_VERSION=4.1.2
APP_VERSION_NAME=2.10.2
BRAND=samsung
PHONE_MODEL=SPH-D710
CUSTOM_DATA=
Commons app version:
2.10.2

Would you like to work on the issue?
Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions