From 8f9aeb83da26902e21ca41f8d17d204d2ac216cf Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 16 Nov 2020 11:38:59 +0100 Subject: [PATCH] fix invalid command converter behaviour --- src/vs/workbench/api/common/extHostCommands.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/common/extHostCommands.ts b/src/vs/workbench/api/common/extHostCommands.ts index e1b3a073915..649612e38f4 100644 --- a/src/vs/workbench/api/common/extHostCommands.ts +++ b/src/vs/workbench/api/common/extHostCommands.ts @@ -276,7 +276,7 @@ export class CommandsConverter { toInternal(command: vscode.Command | undefined, disposables: DisposableStore): ICommandDto | undefined; toInternal(command: vscode.Command | undefined, disposables: DisposableStore): ICommandDto | undefined { - if (!command || !command.command) { + if (!command) { return undefined; } @@ -287,6 +287,11 @@ export class CommandsConverter { tooltip: command.tooltip }; + if (!command.command) { + // falsy command id -> return converted command but don't attempt any + // argument or API-command dance since this command won't run anyways + return result; + } const apiCommand = this._lookupApiCommand(command.command); if (apiCommand) {