Skip to content

Commit

Permalink
check if command is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
vadimkibana committed Dec 4, 2024
1 parent bc52938 commit 9a77291
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,11 @@ function validateCommand(
// do not check the command exists, the grammar is already picking that up
const commandDef = getCommandDefinition(command.name);

if (commandDef?.validate) {
if (!commandDef) {
return messages;
}

if (commandDef.validate) {
messages.push(...commandDef.validate(command));
}

Expand Down

0 comments on commit 9a77291

Please sign in to comment.