Index: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc |
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc |
index 88c60906b7268d02bffd85fdb683ef05c9bca77a..2e1acca58af6e8eb3d3c65d97970986fb5d14cbc 100644 |
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc |
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc |
@@ -870,7 +870,10 @@ void DesktopNativeWidgetAura::SetCursor(gfx::NativeCursor cursor) { |
} |
bool DesktopNativeWidgetAura::IsMouseEventsEnabled() const { |
- if (!content_window_) |
+ // We explicitly check |host_| here because it can be null during the process |
+ // of widget shutdown (even if |content_window_| is not), and must be valid to |
+ // determine if mouse events are enabled. |
+ if (!content_window_ || !host_) |
return false; |
aura::client::CursorClient* cursor_client = |
aura::client::GetCursorClient(host_->window()); |