From 6d8a7316f954766ad3ec3998cbc2f7c58da0792a Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Fri, 4 Nov 2011 20:30:27 +0000 Subject: Work around crash in protector code. The code doesn't deal with the default search engine not existing. This is temporary, a real fix is needed to deal more elegantly with this case. BUG=103027 TEST=none R=avayvod@chromium.org TBR=avayvod@chromium.org Review URL: http://codereview.chromium.org/8479008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108700 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/search_engines/template_url_service.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'chrome/browser/search_engines') diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc index 4a0f658..69a31b2 100644 --- a/chrome/browser/search_engines/template_url_service.cc +++ b/chrome/browser/search_engines/template_url_service.cc @@ -537,7 +537,12 @@ void TemplateURLService::OnWebDataServiceRequestDone( DidDefaultSearchProviderChange( *result, template_urls, - &backup_default_search_provider)) { + &backup_default_search_provider) && + default_search_provider) { + // TODO: need to handle no default_search_provider better. Likely need to + // make sure the default search engine is there, and if not assume it was + // deleted and add it back. + // Protector will delete itself when it's needed no longer. protector::Protector* protector = new protector::Protector(profile()); protector->ShowChange(protector::CreateDefaultSearchProviderChange( -- cgit v1.1