diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-07 20:26:48 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-07 20:26:48 +0000 |
commit | c6176da0f310db393db5f02269f2e83cbe17aacf (patch) | |
tree | 7d8a98e1ac195e4de304d5b37803ec76e31b080d | |
parent | 5dd6986c8dcb3342f00dd7514d058ccb68f1e893 (diff) | |
download | chromium_src-c6176da0f310db393db5f02269f2e83cbe17aacf.zip chromium_src-c6176da0f310db393db5f02269f2e83cbe17aacf.tar.gz chromium_src-c6176da0f310db393db5f02269f2e83cbe17aacf.tar.bz2 |
Fix crash when visiting launcher start page without flag.
When launcher start page flag is not present, StartPageService is not
created. And when the start page is visited in a tab, this causes
a crash.
BUG=304854
R=jamescook@chromium.org
Review URL: https://codereview.chromium.org/26279003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227335 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/webui/app_list/start_page_handler.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/ui/webui/app_list/start_page_handler.cc b/chrome/browser/ui/webui/app_list/start_page_handler.cc index a7be1ee..51b6a8d 100644 --- a/chrome/browser/ui/webui/app_list/start_page_handler.cc +++ b/chrome/browser/ui/webui/app_list/start_page_handler.cc @@ -82,7 +82,11 @@ void StartPageHandler::SendRecommendedApps() { void StartPageHandler::HandleInitialize(const base::ListValue* args) { Profile* profile = Profile::FromWebUI(web_ui()); - recommended_apps_ = StartPageService::Get(profile)->recommended_apps(); + StartPageService* service = StartPageService::Get(profile); + if (!service) + return; + + recommended_apps_ = service->recommended_apps(); recommended_apps_->AddObserver(this); SendRecommendedApps(); |