Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Unified Diff: chrome/browser/ui/webui/sync_setup_handler.cc

Issue 277433003: Fix a crash on showing sync setup dialog in guest mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/sync_setup_handler.cc
diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc
index d3e6f69219a97d1fad116575ae718db47d342399..324fdc826e2d9e98a871fcac22b9b6edeb455fc8 100644
--- a/chrome/browser/ui/webui/sync_setup_handler.cc
+++ b/chrome/browser/ui/webui/sync_setup_handler.cc
@@ -729,8 +729,11 @@ void SyncSetupHandler::HandleConfigure(const base::ListValue* args) {
}
void SyncSetupHandler::HandleShowSetupUI(const base::ListValue* args) {
- ProfileSyncService* service = GetSyncService();
- DCHECK(service);
+ if (!GetSyncService()) {
+ DLOG(WARNING) << "Cannot display sync UI when sync is disabled";
+ CloseUI();
+ return;
+ }
SigninManagerBase* signin =
SigninManagerFactory::GetForProfile(GetProfile());
« no previous file with comments | « chrome/browser/ui/webui/sync_setup_handler.h ('k') | chrome/browser/ui/webui/sync_setup_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698