Commit 5063d69d authored by Friedrich Horschig's avatar Friedrich Horschig Committed by Commit Bot

[Crash][Butter] Prevent nullptr deref for sync_service_

Speculative fix for a rarely-happening null pointer dereference when the
account UI tries to figure out whether to show a moving bubble but the
sync service is not available.


Bug: 1122067
Change-Id: Ieaa81af8eab75c5f5cc66760a3e6cd2298163791
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377721
Commit-Queue: Friedrich [CET] <fhorschig@chromium.org>
Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802174}
parent ad223457
......@@ -305,7 +305,9 @@ void OptOutOfAccountStorageAndClearSettingsForAccount(
bool ShouldShowAccountStorageBubbleUi(const PrefService* pref_service,
const syncer::SyncService* sync_service) {
return !sync_service->IsSyncFeatureEnabled() &&
// `sync_service` is null in incognito mode, or if --disable-sync was
// specified on the command-line.
return sync_service && !sync_service->IsSyncFeatureEnabled() &&
(IsOptedInForAccountStorage(pref_service, sync_service) ||
IsUserEligibleForAccountStorage(sync_service));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment