Commit 35955aca authored by Thomas Tangl's avatar Thomas Tangl Committed by Commit Bot

Fix crash bug in UnifiedConsentService

The UnifiedConsentService needs a SyncService that is
not NULL, otherwise it will crash.

To fix this, the UnifiedConsentServiceFactory only creates
a UnifiedConsentService if the SyncService is not NULL.

Bug: 872451
Change-Id: I3f7c196273ce5cade9b2f1c88c410eae13569bf7
Reviewed-on: https://chromium-review.googlesource.com/1172301
Commit-Queue: Thomas Tangl <tangltom@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582563}
parent c6f93212
......@@ -48,6 +48,8 @@ KeyedService* UnifiedConsentServiceFactory::BuildServiceInstanceFor(
Profile* profile = Profile::FromBrowserContext(context);
syncer::SyncService* sync_service =
ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(profile);
if (!sync_service)
return nullptr;
if (!IsUnifiedConsentEnabled(profile)) {
unified_consent::UnifiedConsentService::RollbackIfNeeded(
......
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