From ed0cf569f40ba5e11402c691c6bef6304d3d45c6 Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Fri, 5 Feb 2010 22:50:41 +0000 Subject: Check for the existance of a profile manager. Might not exist during early shutdown. BUG=34652 TEST=Execute chrome. Run chrome --uninstall. Should not crash. Review URL: http://codereview.chromium.org/572043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38269 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser_process_impl.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chrome/browser/browser_process_impl.cc') diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 2e4d345..db2a310 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -268,6 +268,13 @@ bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) { FilePath user_data_dir; Profile* profile; + // Check for the existance of a profile manager. When quitting early, + // e.g. because another chrome instance is running, or when invoked with + // options such as --uninstall or --try-chrome-again=0, the profile manager + // does not exist yet. + if (!profile_manager_.get()) + return false; + PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); profile = profile_manager_->GetDefaultProfile(user_data_dir); *profile_path = profile->GetPath(); -- cgit v1.1