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

Unified Diff: chrome/browser/sync/glue/sync_start_util.cc

Issue 15408004: sync: null-check ProfileManager in sync_start_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/sync_start_util.cc
diff --git a/chrome/browser/sync/glue/sync_start_util.cc b/chrome/browser/sync/glue/sync_start_util.cc
index e3fd31fc80debb5aa82a046153a21f29c3f7598a..86c336bb780b102d8c3fbde4b7f7a0faea6def5e 100644
--- a/chrome/browser/sync/glue/sync_start_util.cc
+++ b/chrome/browser/sync/glue/sync_start_util.cc
@@ -18,6 +18,12 @@ namespace {
void StartSyncOnUIThread(const base::FilePath& profile,
syncer::ModelType type) {
ProfileManager* profile_manager = g_browser_process->profile_manager();
+ if (!profile_manager) {
+ // Can happen in tests.
+ DVLOG(2) << "No ProfileManager, can't start sync.";
+ return;
+ }
+
Profile* p = profile_manager->GetProfileByPath(profile);
if (!p) {
DVLOG(2) << "Profile not found, can't start sync.";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698