summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-02 02:53:24 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-02 02:53:24 +0000
commit806e020766dd94b11a23d1ee3054d1d3e6045082 (patch)
treea5b4f896d3ea2c2abf9d6338e45e8db985ec16f6 /chrome
parenteb9ba19258bbd0cd7e66a85ad42d58642103c1f0 (diff)
downloadchromium_src-806e020766dd94b11a23d1ee3054d1d3e6045082.zip
chromium_src-806e020766dd94b11a23d1ee3054d1d3e6045082.tar.gz
chromium_src-806e020766dd94b11a23d1ee3054d1d3e6045082.tar.bz2
Fix a crash when hiding the find bar due to a NULL window_delegate_.
Review URL: http://codereview.chromium.org/12854 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6197 0039d316-1c4b-4281-b951-d872f2087c98
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);
}