fix: crash on close window when webContents destroyed (#31620)

This commit is contained in:
Shelley Vohr
2021-11-01 05:32:54 +01:00
committed by GitHub
parent a6e5ff3607
commit 20b4813cf8
2 changed files with 6 additions and 1 deletions

View File

@@ -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.