提交 c1e892c4 编写于 作者: I isidor

debug: null guard if the server crashes before the initialize response.

fixes #1156
上级 2752e42a
......@@ -500,6 +500,10 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
linesStartAt1: true,
pathFormat: 'path'
}).then((result: DebugProtocol.InitializeResponse) => {
if (!this.session) {
return Promise.wrapError(new Error(nls.localize('debugAdapterCrash', "Debug adapter process has terminated unexpectedly")));
}
this.setStateAndEmit(debug.State.Initializing);
return configuration.request === 'attach' ? this.session.attach(configuration) : this.session.launch(configuration);
}).then((result: DebugProtocol.Response) => {
......
......@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import nls = require('vs/nls');
import cp = require('child_process');
import fs = require('fs');
import net = require('net');
......@@ -290,7 +291,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
this.serverProcess = null;
this.cachedInitServer = null;
if (!this.stopServerPending) {
this.messageService.show(severity.Error, 'Debug adapter process has terminated unexpectedly');
this.messageService.show(severity.Error, nls.localize('debugAdapterCrash', "Debug adapter process has terminated unexpectedly"));
}
this.emit(debug.SessionEvents.SERVER_EXIT);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册