Commit dd27914e authored by vadimt's avatar vadimt Committed by Commit bot

Avoiding voice search crash if none of search providers returned anything.

It's highly unlikely that this can happen, but just in case.

The voice search popup will keep staying with no other way to dismiss it except reopening the launcher, but I don't think we should take too much care of this edge case beyond simply not breaking.

Bug=712331

Review-Url: https://codereview.chromium.org/2848493004
Cr-Commit-Position: refs/heads/master@{#468068}
parent 8d0947b6
...@@ -223,7 +223,10 @@ void SearchResultListView::VisibilityChanged(views::View* starting_from, ...@@ -223,7 +223,10 @@ void SearchResultListView::VisibilityChanged(views::View* starting_from,
void SearchResultListView::AnimationEnded(const gfx::Animation* animation) { void SearchResultListView::AnimationEnded(const gfx::Animation* animation) {
DCHECK_EQ(auto_launch_animation_.get(), 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 // The auto-launch has to be canceled explicitly. Think that one of searcher
// is extremely slow. Sometimes the events would happen in the following // is extremely slow. Sometimes the events would happen in the following
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment