File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,6 @@ namespace content {
67
67
void ShellLoginDialog::PlatformCreateDialog (const base::string16& message) {
68
68
DCHECK (BrowserThread::CurrentlyOn (BrowserThread::UI));
69
69
70
- login_view_ = new LoginView (message);
71
-
72
70
// Scary thread safety note: This can potentially be called *after* SetAuth
73
71
// or CancelAuth (say, if the request was cancelled before the UI thread got
74
72
// control). However, that's OK since any UI interaction in those functions
@@ -80,6 +78,15 @@ void ShellLoginDialog::PlatformCreateDialog(const base::string16& message) {
80
78
WebContents* requesting_contents = WebContents::FromRenderFrameHost (rfh);
81
79
WebContentsModalDialogManager* web_contents_modal_dialog_manager =
82
80
WebContentsModalDialogManager::FromWebContents (requesting_contents);
81
+
82
+ if (!web_contents_modal_dialog_manager) {
83
+ UserCancelledAuth ();
84
+ DeleteDelegate ();
85
+ return ;
86
+ }
87
+
88
+ login_view_ = new LoginView (message);
89
+
83
90
WebContentsModalDialogManagerDelegate* modal_delegate =
84
91
web_contents_modal_dialog_manager->delegate ();
85
92
CHECK (modal_delegate);
You can’t perform that action at this time.
0 commit comments