diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index b26b6cca933..77d4c41feef 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -632,6 +632,10 @@ export class DebugService implements debug.IDebugService { this.model.setExceptionBreakpoints(this.session.configuration.capabilities.exceptionBreakpointFilters); return configuration.request === 'attach' ? this.session.attach(configuration) : this.session.launch(configuration); }).then((result: DebugProtocol.Response) => { + if (!this.session) { + return TPromise.as(null); + } + if (configuration.internalConsoleOptions === 'openOnSessionStart' || (!this.viewModel.changedWorkbenchViewState && configuration.internalConsoleOptions !== 'neverOpen')) { this.panelService.openPanel(debug.REPL_ID, false).done(undefined, errors.onUnexpectedError); } @@ -942,6 +946,7 @@ export class DebugService implements debug.IDebugService { private lazyTransitionToRunningState(threadId?: number): void { let setNewFocusedStackFrameScheduler: RunOnceScheduler; + const toDispose = this.session.onDidStop(e => { if (e.body.threadId === threadId || e.body.allThreadsStopped || !threadId) { setNewFocusedStackFrameScheduler.cancel(); diff --git a/src/vs/workbench/parts/debug/node/rawDebugSession.ts b/src/vs/workbench/parts/debug/node/rawDebugSession.ts index c0c7a455d04..24303d0bf7f 100644 --- a/src/vs/workbench/parts/debug/node/rawDebugSession.ts +++ b/src/vs/workbench/parts/debug/node/rawDebugSession.ts @@ -221,7 +221,10 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes } private readCapabilities(response: DebugProtocol.Response): DebugProtocol.Response { - this.capabilities = objects.mixin(this.capabilities, response.body); + if (response) { + this.capabilities = objects.mixin(this.capabilities, response.body); + } + return response; }