Commit 59f9c856 authored by Matthew Mourgos's avatar Matthew Mourgos Committed by Commit Bot

Add check for search_result_ pointer to prevent browser crash


Fixes browser crash after search result answer card search

Bug: 910388
Change-Id: I7ab881d2cf4da2920439be73da2977a7c436b6af
Reviewed-on: https://chromium-review.googlesource.com/c/1356715Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarWeidong Guo <weidongg@chromium.org>
Commit-Queue: Matthew Mourgos <mmourgos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612954}
parent 41e4b43a
......@@ -276,7 +276,8 @@ class SearchResultAnswerCardView::SearchAnswerContainerView
AddChildView(content_view);
ExcludeCardFromEventHandling(contents_->GetView()->native_view());
if (search_result_->equivalent_result_id().has_value()) {
if (search_result_ &&
search_result_->equivalent_result_id().has_value()) {
view_delegate_->GetSearchModel()->DeleteResultById(
search_result_->equivalent_result_id().value());
}
......
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