Merge pull request #10275 from electron/windowclose-exception
Fixing uncaught exception on window close
This commit is contained in:
commit
15db4ee450
1 changed files with 4 additions and 1 deletions
|
@ -465,6 +465,9 @@ ipcMain.on('ELECTRON_BROWSER_WINDOW_CONFIRM', function (event, message, title) {
|
||||||
|
|
||||||
// Implements window.close()
|
// Implements window.close()
|
||||||
ipcMain.on('ELECTRON_BROWSER_WINDOW_CLOSE', function (event) {
|
ipcMain.on('ELECTRON_BROWSER_WINDOW_CLOSE', function (event) {
|
||||||
event.sender.getOwnerBrowserWindow().close()
|
const window = event.sender.getOwnerBrowserWindow()
|
||||||
|
if (window) {
|
||||||
|
window.close()
|
||||||
|
}
|
||||||
event.returnValue = null
|
event.returnValue = null
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue