-
Notifications
You must be signed in to change notification settings - Fork 124
Guard against Banner/Interstitial use of nullptr callbacks #744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -177,7 +177,6 @@ public void destroy(final long callbackDataPtr) { | |||
completeBannerViewFutureCallback(callbackDataPtr, | |||
ConstantsHelper.CALLBACK_ERROR_NONE, | |||
ConstantsHelper.CALLBACK_ERROR_MESSAGE_NONE); | |||
mNotifyBoundingBoxListenerOnNextDraw.set(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wouldn't have done anything, anyway, as the mAdView was already set to null. Also there's a synchronous bounding box changed event immediately prior to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add some logs or throw errors when it's a nullptr?
I don't think so. The most common scenario is starting the process of destroying the C++ object when suddenly a listener is invoked from Android and iOS about movement, clicks, etc. This isn't a misconfiguration just a race condition. Or, say, respond to AdClosed by destroying the object before the final bounding box listener event triggers a -1,-1,-1,-1 bounding box, since AdClosed and the BoundingBox change are different events. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check no pointer erros. LGTM.
❌ Integration test FAILEDRequested by @DellaBitta on commit 27203e2
Add flaky tests to go/fpl-cpp-flake-tracker |
Description
Check to see if Interstitial and BannerView callback pointers have been nullified before invoking them in Java.
Testing
Ran iTests on Android phone.
iTest Run
Type of Change
Place an
x
the applicable box: