Merge pull request #10275 from electron/windowclose-exception

Fixing uncaught exception on window close
This commit is contained in:
Samuel Attard 2017-08-19 13:58:55 +10:00 committed by GitHub
commit 15db4ee450

View file

@ -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
}) })