window - do not send IPC messages to destroyed windows (fix #114564)

This commit is contained in:
Benjamin Pasero
2021-01-19 14:49:40 +01:00
parent 635d7af638
commit 5a4d90a550
3 changed files with 15 additions and 8 deletions

View File

@@ -271,7 +271,6 @@ export class CodeApplication extends Disposable {
//#region Bootstrap IPC Handlers
ipcMain.on('vscode:fetchShellEnv', async event => {
const webContents = event.sender;
const window = this.windowsMainService?.getWindowByWebContents(event.sender);
let replied = false;
@@ -283,9 +282,7 @@ export class CodeApplication extends Disposable {
if (!replied) {
replied = true;
if (!webContents.isDestroyed()) {
webContents.send('vscode:acceptShellEnv', env);
}
window?.send('vscode:acceptShellEnv', env);
}
}