Fixing uncaught exception on window close

This commit is contained in:
Hari Juturu 2017-08-15 14:59:48 -07:00
parent a419fe75ca
commit 9120774c00

View file

@ -465,6 +465,10 @@ ipcMain.on('ELECTRON_BROWSER_WINDOW_CONFIRM', function (event, message, title) {
// Implements window.close()
ipcMain.on('ELECTRON_BROWSER_WINDOW_CLOSE', function (event) {
event.sender.getOwnerBrowserWindow().close()
event.returnValue = null
try {
event.sender.getOwnerBrowserWindow().close()
event.returnValue = null
} catch (error) {
event.returnValue = exceptionToMeta(error)
}
})