提交 adcd4e9f 编写于 作者: I isidor

debug: null guards that help when launching invalid js

上级 d2bc1eb8
......@@ -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();
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册