summaryrefslogtreecommitdiffstats
path: root/chrome/views/dialog_client_view.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 22:06:48 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 22:06:48 +0000
commit1783b41dcb79e92d83c28e327bad0b366c59af7f (patch)
tree95acd84c6dbcaffb711d4d0a8fb168fbfc1cc1bc /chrome/views/dialog_client_view.cc
parentd9056166ac600fd4c261d81a9da1f5ba855e6bd8 (diff)
downloadchromium_src-1783b41dcb79e92d83c28e327bad0b366c59af7f.zip
chromium_src-1783b41dcb79e92d83c28e327bad0b366c59af7f.tar.gz
chromium_src-1783b41dcb79e92d83c28e327bad0b366c59af7f.tar.bz2
Guard against a crash that can impact Dialog boxes ... this one seems to have already impacted Window itself, but a NULL check was already inserted in that code.
http://crbug.com/4355 Review URL: http://codereview.chromium.org/40183 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11047 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/dialog_client_view.cc')
-rw-r--r--chrome/views/dialog_client_view.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/views/dialog_client_view.cc b/chrome/views/dialog_client_view.cc
index c32b17c..60da308 100644
--- a/chrome/views/dialog_client_view.cc
+++ b/chrome/views/dialog_client_view.cc
@@ -309,6 +309,11 @@ bool DialogClientView::AcceleratorPressed(const Accelerator& accelerator) {
// DialogClientView, NativeButton::Listener implementation:
void DialogClientView::ButtonPressed(NativeButton* sender) {
+ // We NULL check the delegate here since the buttons can receive WM_COMMAND
+ // messages even after they (and the window containing us) are destroyed.
+ if (GetDialogDelegate())
+ return;
+
if (sender == ok_button_) {
AcceptWindow();
} else if (sender == cancel_button_) {