Chromium Code Reviews| Index: ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.mm |
| diff --git a/ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.mm b/ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.mm |
| index 4f1be95a138fbede477a10838c6df09292275a00..2bc0022405217b032abcd9a24dff53a3b4fa5290 100644 |
| --- a/ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.mm |
| +++ b/ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.mm |
| @@ -72,9 +72,11 @@ |
| - (void)stopFinding { |
| web::WebState* webState = self.webStateList->GetActiveWebState(); |
| - FindTabHelper* helper = FindTabHelper::FromWebState(webState); |
| - DCHECK(helper); |
| - helper->StopFinding(nil); |
| + if (webState) { |
| + FindTabHelper* helper = FindTabHelper::FromWebState(webState); |
|
edchin
2017/05/27 18:47:26
This crashes when the last web state is detached w
|
| + DCHECK(helper); |
| + helper->StopFinding(nil); |
| + } |
| } |
| - (void)findResultsAvailable:(FindInPageModel*)model { |