prebid / prebid-mobile-android

Prebid Mobile SDK for Android applications
Apache License 2.0
57 stars 82 forks source link

NullPointerException in Requester.sendAdException #680

Closed linean closed 1 year ago

linean commented 1 year ago

Describe the bug After recent update from 2.1.0 to 2.1.3 we've started to notice new NullPointerException coming from Requester.sendAdException. I hope the following stacktrace will help you to find it.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void org.prebid.mobile.rendering.networking.ResponseHandler.onErrorWithException(java.lang.Exception, long)' on a null object reference
       at org.prebid.mobile.rendering.networking.modelcontrollers.Requester.sendAdException(Requester.java:152)
       at org.prebid.mobile.rendering.networking.modelcontrollers.Requester.makeAdRequest(Requester.java:169)
       at org.prebid.mobile.rendering.networking.modelcontrollers.Requester$1.adIdFetchCompletion(Requester.java:132)
       at org.prebid.mobile.rendering.utils.helpers.AdIdManager$FetchAdIdInfoTask.onPostExecute(AdIdManager.java:142)
       at org.prebid.mobile.rendering.utils.helpers.AdIdManager$FetchAdIdInfoTask.onPostExecute(AdIdManager.java:100)
       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:6923)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870)
jsligh commented 1 year ago

The responseHandler could be null so I'm surrounding it with null checks to make sure this error doesn't happen again.

YuriyVelichkoPI commented 1 year ago

@linean there is no need to close the issue manually. It will be closed once the PR is merged.