summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/views/window.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/views/window.cc b/chrome/views/window.cc
index 6c61ff0..051cd1f 100644
--- a/chrome/views/window.cc
+++ b/chrome/views/window.cc
@@ -330,7 +330,9 @@ LRESULT Window::OnAppCommand(HWND window, short app_command, WORD device,
}
void Window::OnCommand(UINT notification_code, int command_id, HWND window) {
- if (!window_delegate_->ExecuteWindowsCommand(command_id))
+ // We NULL check |window_delegate_| here because we can be sent WM_COMMAND
+ // messages even after the window is destroyed.
+ if (!window_delegate_ || !window_delegate_->ExecuteWindowsCommand(command_id))
WidgetWin::OnCommand(notification_code, command_id, window);
}