diff --git a/src/commands/optionresolver.ts b/src/commands/optionresolver.ts index 321fa07..619c525 100644 --- a/src/commands/optionresolver.ts +++ b/src/commands/optionresolver.ts @@ -74,7 +74,7 @@ export class OptionResolver { } getAutocomplete() { - return (this.getCommand()?.options as CommandOption[]).find( + return (this.getCommand()?.options as CommandOption[] | undefined)?.find( option => option.name === this.hoistedOptions.find(x => x.focused)?.name, ) as CommandAutocompleteOption | undefined; }