Skip to content

Commit

Permalink
Merge pull request #8933 from brave/pr8929_sync_crash_on_reset_1.25.x
Browse files Browse the repository at this point in the history
Check local_device_info to avoid crash on reset (uplift to 1.25.x)
  • Loading branch information
kjozwiak authored May 27, 2021
2 parents a6f4544 + e5d4e69 commit b271437
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/brave_sync/profile_sync_service_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ void ResetSync(syncer::BraveProfileSyncService* sync_service,
const syncer::DeviceInfo* local_device_info =
device_info_service->GetLocalDeviceInfoProvider()->GetLocalDeviceInfo();

// Remove DCHECK when will be found the reason of the issue
// https://github.com/brave/brave-browser/issues/16066 .
DCHECK(local_device_info);
if (!local_device_info) {
return;
}

sync_service->SuspendDeviceObserverForOwnReset();

tracker->DeleteDeviceInfo(
Expand Down

0 comments on commit b271437

Please sign in to comment.