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

Unified Diff: ui/app_list/views/search_result_list_view.cc

Issue 2848493004: Avoiding voice search crash if none of search providers returned anything. (Closed)
Patch Set: Created 3 years, 8 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: ui/app_list/views/search_result_list_view.cc
diff --git a/ui/app_list/views/search_result_list_view.cc b/ui/app_list/views/search_result_list_view.cc
index dda543115bce9e75af49f82d1ae832f18c1c321a..8b7e4b93007c1e9bef6960af64993247d46dd0ce 100644
--- a/ui/app_list/views/search_result_list_view.cc
+++ b/ui/app_list/views/search_result_list_view.cc
@@ -223,7 +223,10 @@ void SearchResultListView::VisibilityChanged(views::View* starting_from,
void SearchResultListView::AnimationEnded(const gfx::Animation* animation) {
DCHECK_EQ(auto_launch_animation_.get(), animation);
- view_delegate_->OpenSearchResult(results()->GetItemAt(0), true, ui::EF_NONE);
+ if (results()->item_count() > 0) {
+ view_delegate_->OpenSearchResult(results()->GetItemAt(0), true,
+ ui::EF_NONE);
+ }
// The auto-launch has to be canceled explicitly. Think that one of searcher
// is extremely slow. Sometimes the events would happen in the following
« 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