fix(app): messaging on closing

This commit is contained in:
Alexey Kasyanchuk 2018-02-17 20:16:07 +03:00
parent 196f04645c
commit cbab33039a

View File

@ -323,7 +323,10 @@ app.on("ready", () => {
if (env.name === "production") { autoUpdater.checkForUpdates() } if (env.name === "production") { autoUpdater.checkForUpdates() }
spider = spiderCall((...data) => mainWindow.webContents.send(...data), (message, callback) => { spider = spiderCall((...data) => {
if(mainWindow)
mainWindow.webContents.send(...data)
}, (message, callback) => {
ipcMain.on(message, (event, arg) => { ipcMain.on(message, (event, arg) => {
if(Array.isArray(arg) && typeof arg[arg.length - 1] === 'object' && arg[arg.length - 1].callback) if(Array.isArray(arg) && typeof arg[arg.length - 1] === 'object' && arg[arg.length - 1].callback)
{ {