Skip to content

Commit

Permalink
Intermittent crash in Confirmations due to invalid wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
tmancey committed Apr 24, 2020
1 parent f8305a2 commit a858e94
Show file tree
Hide file tree
Showing 16 changed files with 596 additions and 483 deletions.
8 changes: 4 additions & 4 deletions test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,11 @@ test("brave_unit_tests") {
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/payments_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/confirmations_create_confirmation_request_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/confirmations_fetch_payment_token_request_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/confirmations_get_signed_tokens_request_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/get_signed_tokens_request_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/confirmations_redeem_payment_tokens_request_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/confirmations_request_signed_tokens_request_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/confirmations_security_helper_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/confirmations_string_helper_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/request_signed_tokens_request_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/security_helper_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/string_helper_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/confirmations_unblinded_tokens_unittest.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/confirmations_client_mock.cc",
"//brave/vendor/bat-native-confirmations/src/bat/confirmations/internal/confirmations_client_mock.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ AdsRewards::~AdsRewards() = default;
void AdsRewards::Update(
const WalletInfo& wallet_info,
const bool should_refresh) {
DCHECK(!wallet_info.payment_id.empty());
DCHECK(!wallet_info.private_key.empty());

wallet_info_ = WalletInfo(wallet_info);

Update();

if (!should_refresh) {
Expand All @@ -50,6 +45,12 @@ void AdsRewards::Update(
return;
}

wallet_info_ = wallet_info;
if (!wallet_info_.IsValid()) {
BLOG(ERROR) << "Failed to fetch ads rewards due to invalid wallet";
return;
}

BLOG(INFO) << "Fetch ads rewards";
GetPaymentBalance();
}
Expand Down

This file was deleted.

Loading

0 comments on commit a858e94

Please sign in to comment.