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

Unified Diff: chrome/browser/js_modal_dialog.cc

Issue 2803017: Fix a crash when we try to close a js dialog that wasn't shown. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 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 | « chrome/browser/app_modal_dialog_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/js_modal_dialog.cc
diff --git a/chrome/browser/js_modal_dialog.cc b/chrome/browser/js_modal_dialog.cc
index 37253b93b1e09ea8d698269759f90647546b64dc..111aa01af5c640a79ff157058d6f11a1f14e0516 100644
--- a/chrome/browser/js_modal_dialog.cc
+++ b/chrome/browser/js_modal_dialog.cc
@@ -29,6 +29,9 @@ JavaScriptAppModalDialog::JavaScriptAppModalDialog(
bool is_before_unload_dialog,
IPC::Message* reply_msg)
: AppModalDialog(client->AsTabContents(), title),
+#if defined(OS_MACOSX)
+ dialog_(NULL),
+#endif
client_(client),
extension_host_(client->AsExtensionHost()),
dialog_flags_(dialog_flags),
@@ -64,7 +67,8 @@ void JavaScriptAppModalDialog::Observe(NotificationType type,
// Also clear the client, since it's now invalid.
skip_this_dialog_ = true;
client_ = NULL;
- CloseModalDialog();
+ if (dialog_)
+ CloseModalDialog();
}
void JavaScriptAppModalDialog::InitNotifications() {
@@ -136,4 +140,3 @@ void JavaScriptAppModalDialog::Cleanup() {
}
AppModalDialog::Cleanup();
}
-
« no previous file with comments | « chrome/browser/app_modal_dialog_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698