Skip to content

A bug in java example RewardedVideoExample in rewarded ad load condition #775

@hannayurkevich

Description

@hannayurkevich

Hi guys,

I'm investigating the code for rewarded ads load in RewardedVideoExample and I can't get the idea of line 105:

if (rewardedAd != null && !isLoading && googleMobileAdsConsentManager.canRequestAds()) {
  loadRewardedAd();
}

And rewardedAd != null check doesn't make sense to me considering that loadRewardedAd() method then checks it for null:

private void loadRewardedAd() {
    if (rewardedAd == null) {
        // load logic here
    }
}

But I suppose this check was added for some reason and I would really appreciate it if someone explain it.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions