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

Unified Diff: ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.mm

Issue 2904053002: [ios] Active web state observer in tab collection. (Closed)
Patch Set: Address comments. Created 3 years, 7 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
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 {

Powered by Google App Engine
This is Rietveld 408576698