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

Unified Diff: chrome/browser/autocomplete/search_provider.cc

Issue 3532004: [omnibox] Ignore empty search suggestions. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/search_provider.cc
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 0ec478c20151c53609d0992b57677dbfdfb8ffbd..a13ef3ed95ff723b087b81ef964f36c73e846c1a 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -455,6 +455,12 @@ bool SearchProvider::ParseSuggestResults(Value* root_val,
!suggestion_val->GetAsString(&suggestion_str))
return false;
+ // Google search may return empty suggestions for weird input characters,
+ // they make no sense at all and can cause problem in our code.
+ // See http://crbug.com/56214
+ if (!suggestion_str.length())
+ continue;
+
Value* type_val;
std::string type_str;
if (type_list && type_list->Get(i, &type_val) &&
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698