Skip to content

Commit

Permalink
Fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Shin-NiL committed Mar 5, 2020
1 parent c3bfdfc commit 9ee1dbc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions admob-plugin/src/GodotAdMob.java
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,15 @@ public void showBanner()
{
@Override public void run()
{
if (adView.getVisibility() == View.VISIBLE) return;
if (adView == null) {
Log.w("w", "AdMob: showBanner - banner not loaded");
return;
}

if (adView.getVisibility() == View.VISIBLE) {
return;
}

adView.setVisibility(View.VISIBLE);
adView.resume();
Log.d("godot", "AdMob: Show Banner");
Expand Down Expand Up @@ -444,7 +452,7 @@ public void showInterstitial()
{
@Override public void run()
{
if (interstitialAd.isLoaded()) {
if (interstitialAd != null && interstitialAd.isLoaded()) {
interstitialAd.show();
} else {
Log.w("w", "AdMob: showInterstitial - interstitial not loaded");
Expand Down

0 comments on commit 9ee1dbc

Please sign in to comment.