Skip to content

Commit

Permalink
fix(admob, ios): null check interstitialAd on show (#4670)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guglio authored Dec 14, 2020
1 parent f26a123 commit c3b4cb0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ public void interstitialShow(int requestId, ReadableMap showOptions, Promise pro
}
getCurrentActivity().runOnUiThread(() -> {
InterstitialAd interstitialAd = interstitialAdArray.get(requestId);
if (interstitialAd == null) {
rejectPromiseWithCodeAndMessage(promise, "null-interstitialAd", "Interstitial ad attempted to show but its object was null.");
return;
}

if (showOptions.hasKey("immersiveModeEnabled")) {
interstitialAd.setImmersiveMode(showOptions.getBoolean("immersiveModeEnabled"));
Expand Down

1 comment on commit c3b4cb0

@vercel
Copy link

@vercel vercel bot commented on c3b4cb0 Dec 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.