From c6176da0f310db393db5f02269f2e83cbe17aacf Mon Sep 17 00:00:00 2001 From: "xiyuan@chromium.org" Date: Mon, 7 Oct 2013 20:26:48 +0000 Subject: 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 --- chrome/browser/ui/webui/app_list/start_page_handler.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); -- cgit v1.1