mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: crash on close window when webContents destroyed (#31620)
This commit is contained in:
@@ -254,7 +254,7 @@ void BrowserWindow::OnCloseButtonClicked(bool* prevent_default) {
|
||||
ScheduleUnresponsiveEvent(5000);
|
||||
|
||||
// Already closed by renderer.
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !api_web_contents_)
|
||||
return;
|
||||
|
||||
// Required to make beforeunload handler work.
|
||||
|
||||
Reference in New Issue
Block a user