diff --git a/main.js b/main.js index 87b8c8c7da2e..89c13183d01c 100644 --- a/main.js +++ b/main.js @@ -361,6 +361,11 @@ async function startApp() { // we will refactor this to not use electron IPC, which will make it much // more efficient. ipcMain.on('getWorkerWindowId', event => { + if (workerWindow.isDestroyed()) { + // prevent potential race-condition issues on app close + // https://github.com/stream-labs/desktop/pull/4239 + return; + } event.returnValue = workerWindow.webContents.id; });