Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ads] Fixes crash when migrating the legacy confirmation queue #22520

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void MigrateConfirmationState(InitializeCallback callback) {
[](InitializeCallback callback,
const std::optional<std::string>& json) {
if (!json) {
// Confirmation state does not exist
// Confirmation state does not exist.
return SuccessfullyMigrated(std::move(callback));
}

Expand All @@ -63,7 +63,11 @@ void MigrateConfirmationState(InitializeCallback callback) {

const absl::optional<ConfirmationList> confirmations =
json::reader::ReadConfirmations(*json);
CHECK(confirmations);
if (!confirmations) {
// Confirmation queue state does not exist.
return SuccessfullyMigrated(std::move(callback));
}

ConfirmationQueueItemList confirmation_queue_items;
for (const auto& confirmation : *confirmations) {
const ConfirmationQueueItemInfo confirmation_queue_item =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ std::optional<ConfirmationInfo> ParseConfirmation(
// User data
if (const auto* const value = dict.FindDict(kConfirmationUserDataKey)) {
confirmation.user_data.fixed = value->Clone();
} else {
return std::nullopt;
}

// Reward
Expand Down
Loading