Skip to content

Commit

Permalink
Merge pull request #8605 from brave/ads-test-crash-fix
Browse files Browse the repository at this point in the history
use the pref, not ads service to check enabled state
  • Loading branch information
bridiver authored Apr 22, 2021
2 parents 1a0d5c4 + 82e0e19 commit 979f178
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions components/brave_rewards/browser/rewards_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3409,8 +3409,7 @@ bool RewardsServiceImpl::IsRewardsEnabled() const {
if (profile_->GetPrefs()->GetBoolean(prefs::kAutoContributeEnabled))
return true;

auto* ads_service = brave_ads::AdsServiceFactory::GetForProfile(profile_);
if (ads_service && ads_service->IsEnabled())
if (profile_->GetPrefs()->GetBoolean(ads::prefs::kEnabled))
return true;

return false;
Expand Down

0 comments on commit 979f178

Please sign in to comment.