Skip to content

Commit c3b4cb0

Browse files
author
Guglio
authored
fix(admob, ios): null check interstitialAd on show (#4670)
1 parent f26a123 commit c3b4cb0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/admob/android/src/main/java/io/invertase/firebase/admob/ReactNativeFirebaseAdMobInterstitialModule.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ public void interstitialShow(int requestId, ReadableMap showOptions, Promise pro
125125
}
126126
getCurrentActivity().runOnUiThread(() -> {
127127
InterstitialAd interstitialAd = interstitialAdArray.get(requestId);
128+
if (interstitialAd == null) {
129+
rejectPromiseWithCodeAndMessage(promise, "null-interstitialAd", "Interstitial ad attempted to show but its object was null.");
130+
return;
131+
}
128132

129133
if (showOptions.hasKey("immersiveModeEnabled")) {
130134
interstitialAd.setImmersiveMode(showOptions.getBoolean("immersiveModeEnabled"));

0 commit comments

Comments
 (0)