debug: process.session.root can be undefined

fixes #37559
This commit is contained in:
isidor
2017-11-07 11:11:00 +01:00
parent 479910d9a4
commit 32a8a5c2ab
2 changed files with 3 additions and 3 deletions
@@ -411,7 +411,7 @@ export class DebugService implements debug.IDebugService {
this.toDisposeOnSessionEnd.get(session.getId()).push(session.onDidExitAdapter(event => {
// 'Run without debugging' mode VSCode must terminate the extension host. More details: #3905
if (strings.equalsIgnoreCase(process.configuration.type, 'extensionhost') && this.sessionStates.get(session.getId()) === debug.State.Running &&
process && this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY && process.configuration.noDebug) {
process && process.session.root && process.configuration.noDebug) {
this.broadcastService.broadcast({
channel: EXTENSION_CLOSE_EXTHOST_BROADCAST_CHANNEL,
payload: [process.session.root.uri.fsPath]
@@ -902,7 +902,7 @@ export class DebugService implements debug.IDebugService {
watchExpressionsCount: this.model.getWatchExpressions().length,
extensionName: `${adapter.extensionDescription.publisher}.${adapter.extensionDescription.name}`,
isBuiltin: adapter.extensionDescription.isBuiltin,
launchJsonExists: this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY && !!this.configurationService.getConfiguration<debug.IGlobalConfig>('launch', { resource: root.uri })
launchJsonExists: root && !!this.configurationService.getConfiguration<debug.IGlobalConfig>('launch', { resource: root.uri })
});
}).then(() => process, (error: any) => {
if (error instanceof Error && error.message === 'Canceled') {
@@ -35,7 +35,7 @@ export class Adapter {
public getAdapterExecutable(root: IWorkspaceFolder, verifyAgainstFS = true): TPromise<IAdapterExecutable> {
if (this.rawAdapter.adapterExecutableCommand) {
if (this.rawAdapter.adapterExecutableCommand && root) {
return this.commandService.executeCommand<IAdapterExecutable>(this.rawAdapter.adapterExecutableCommand, root.uri.toString()).then(ad => {
return this.verifyAdapterDetails(ad, verifyAgainstFS);
});