From 9120774c0084d9447e78eeb4d95b33b49607493d Mon Sep 17 00:00:00 2001 From: Hari Juturu Date: Tue, 15 Aug 2017 14:59:48 -0700 Subject: [PATCH] Fixing uncaught exception on window close --- lib/browser/rpc-server.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/browser/rpc-server.js b/lib/browser/rpc-server.js index 815298d3d9de..c36b85566112 100644 --- a/lib/browser/rpc-server.js +++ b/lib/browser/rpc-server.js @@ -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) + } })