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

Unified Diff: chrome/browser/search_engines/template_url_service_android.cc

Issue 2676443002: [Android] Further speculative fixes for search engine crashes. (Closed)
Patch Set: Created 3 years, 11 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 | « chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url_service_android.cc
diff --git a/chrome/browser/search_engines/template_url_service_android.cc b/chrome/browser/search_engines/template_url_service_android.cc
index bccd8d7dd2ad17d4fa74efd31e570c5b5b4bac89..a5b5b391551767cc8d143bcd9ab182c4e37c27f7 100644
--- a/chrome/browser/search_engines/template_url_service_android.cc
+++ b/chrome/browser/search_engines/template_url_service_android.cc
@@ -301,7 +301,8 @@ TemplateUrlServiceAndroid::GetSearchEngineUrlFromTemplateUrl(
base::android::ConvertJavaStringToUTF16(env, jkeyword);
TemplateURL* template_url =
template_url_service_->GetTemplateURLForKeyword(keyword);
- CHECK(template_url) << "Failed to find template URL for keyword: " << keyword;
+ if (!template_url)
+ return base::android::ScopedJavaLocalRef<jstring>(env, nullptr);
std::string url(template_url->url_ref().ReplaceSearchTerms(
TemplateURLRef::SearchTermsArgs(base::ASCIIToUTF16("query")),
template_url_service_->search_terms_data()));
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698