Describe the bug
When using the GMA next-gen SDK for Android in combination with the Prebid Android SDK 3.3.1.
If the SDK encounters any bid response error here:
// AdUnit.java
@Override
public void onError(AdException exception) {
LogUtil.error(TAG, "Bid response error: " + exception);
bidResponse = null;
Util.apply(null, adObject);
originalListener.onComplete(convertToResultCode(exception));
}
The Util apply method then passes null into the bids parameter for handleNextGenSdkTargeting causing an NullPointerException when invoking java.util.Set java.util.HashMap.entrySet().
Full stack trace:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Set java.util.HashMap.entrySet()' on a null object reference
at org.prebid.mobile.Util.handleNextGenSdkTargeting(Util.java:420)
at org.prebid.mobile.Util.apply(Util.java:360)
at org.prebid.mobile.AdUnit$1.onError(AdUnit.java:307)
at org.prebid.mobile.rendering.bidding.loader.BidLoader.failedToLoadBid(BidLoader.java:209)
at org.prebid.mobile.rendering.bidding.loader.BidLoader.-$$Nest$mfailedToLoadBid(Unknown Source:0)
at org.prebid.mobile.rendering.bidding.loader.BidLoader$1.onErrorWithException(BidLoader.java:90)
at org.prebid.mobile.rendering.networking.BaseNetworkTask.onPostExecute(BaseNetworkTask.java:100)
at org.prebid.mobile.rendering.networking.BaseNetworkTask.onPostExecute(BaseNetworkTask.java:38)
at android.os.AsyncTask.finish(AsyncTask.java:771)
at android.os.AsyncTask.-$$Nest$mfinish(Unknown Source:0)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8705)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
To Reproduce
In my case I encountered an SSL error due to a certificate issue with my internet provider however this could occur due to any relevant error which then calls onError inside AdUnit.
- Open PrebidNextGenDemo App
- Tap on an example Ad e.g. Banner Ad Unit.
Expected behavior
If an error occurs during Prebid Bid Load process, SDK handles this scenario without crash.
Screenshots
N/A
Smartphone (please complete the following information):
- Device: Android Pixel 2 Emulator
- OS: API 35
- SDK Version 3.3.1
Additional context
Add any other context about the problem here.
Describe the bug
When using the GMA next-gen SDK for Android in combination with the Prebid Android SDK 3.3.1.
If the SDK encounters any bid response error here:
The Util
applymethod then passesnullinto the bids parameter for handleNextGenSdkTargeting causing an NullPointerException when invoking java.util.Set java.util.HashMap.entrySet().Full stack trace:
To Reproduce
In my case I encountered an SSL error due to a certificate issue with my internet provider however this could occur due to any relevant error which then calls onError inside AdUnit.
Expected behavior
If an error occurs during Prebid Bid Load process, SDK handles this scenario without crash.
Screenshots
N/A
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.