Don't assume a command is found in "Find and select command" command bar action (#2019)

This commit is contained in:
Frank Noirot
2024-04-04 19:15:26 -04:00
committed by GitHub
parent 24caeece65
commit 8ac0bf4953
2 changed files with 12 additions and 4 deletions

View File

@ -402,8 +402,8 @@ export const commandBarMachine = createMachine(
'Initialize arguments to submit': assign({
argumentsToSubmit: (c, e) => {
const command =
'command' in e.data ? e.data.command : c.selectedCommand!
if (!command.args) return {}
'command' in e.data ? e.data.command : c.selectedCommand
if (!command?.args) return {}
const args: { [x: string]: unknown } = {}
for (const [argName, arg] of Object.entries(command.args)) {
args[argName] =