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

Unified Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2951753002: Replace a DCHECK in BVC with an early return. (Closed)
Patch Set: comments Created 3 years, 6 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: ios/chrome/browser/ui/browser_view_controller.mm
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index 1beacd5bfcf280a37bc1afa71678e7b0c02942bd..9f094c76cb969094aa005718fd0be43fc4aef212 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -4404,7 +4404,12 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
}
- (void)updateFindBar:(BOOL)initialUpdate shouldFocus:(BOOL)shouldFocus {
- DCHECK([_model currentTab]);
+ // TODO(crbug.com/731045): This early return temporarily replaces a DCHECK.
+ // For unknown reasons, this DCHECK sometimes was hit in the wild, resulting
+ // in a crash.
+ if (![_model currentTab]) {
+ return;
+ }
auto* helper = FindTabHelper::FromWebState([_model currentTab].webState);
if (helper && helper->IsFindUIActive()) {
if (initialUpdate && !_isOffTheRecord) {
« 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