feat(zcashd): check if window is open before send ipcMain emitter

This commit is contained in:
George Lima 2019-01-29 19:58:27 -03:00
parent c3c85bd788
commit 689987980c
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ const runDaemon: () => Promise<?ChildProcess> = () => new Promise(async (resolve
});
childProcess.stdout.on('data', (data) => {
if (mainWindow && mainWindow.webContents) mainWindow.webContents.send('zcashd-log', data.toString());
if (!mainWindow.isDestroyed()) mainWindow.webContents.send('zcashd-log', data.toString());
if (!resolved) {
resolve(childProcess);
resolved = true;