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

Unified Diff: ui/views/focus/focus_manager.cc

Issue 2047083002: Do not allow NULL to be passed into FocusManager::ViewRemoved. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: do not allow NULL at all Created 4 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 | ui/views/widget/widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/focus/focus_manager.cc
diff --git a/ui/views/focus/focus_manager.cc b/ui/views/focus/focus_manager.cc
index bd6b0dc19fe4749a958afe41f8c49dd158ed446a..80a4dc8d6bdd0c7b67ee984e6081e434cebe6db1 100644
--- a/ui/views/focus/focus_manager.cc
+++ b/ui/views/focus/focus_manager.cc
@@ -517,7 +517,8 @@ void FocusManager::ViewRemoved(View* removed) {
// clear the focus. However, it's not safe to call ClearFocus()
// (and in turn ClearNativeFocus()) here because ViewRemoved() can
// be called while the top level widget is being destroyed.
- if (focused_view_ && removed->Contains(focused_view_))
+ DCHECK(removed);
+ if (removed->Contains(focused_view_))
SetFocusedView(NULL);
}
« no previous file with comments | « no previous file | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698