From e3ba8a48c173eab6cb7f727ebc79332b8ac57370 Mon Sep 17 00:00:00 2001 From: Amy Qiu Date: Fri, 4 Aug 2017 10:05:45 -0700 Subject: [PATCH] Fix NPE --- .../parts/terminal/electron-browser/terminalInstance.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index 3baad14fae8..ce7b9dafe0c 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -161,7 +161,11 @@ export class TerminalInstance implements ITerminalInstance { this._createXterm(); if (platform.isWindows) { - this._processReady.then(() => this._windowsShellHelper = new WindowsShellHelper(this._processId, this._shellLaunchConfig.executable, this, this._xterm)); + this._processReady.then(() => { + if (!this._isDisposed) { + this._windowsShellHelper = new WindowsShellHelper(this._processId, this._shellLaunchConfig.executable, this, this._xterm); + } + }); } // Only attach xterm.js to the DOM if the terminal panel has been opened before.