fix(CommandInteraction): cmds with no options throw error (#5734)

This commit is contained in:
Shubham Parihar
2021-06-03 14:04:40 +05:30
committed by GitHub
parent fdad140997
commit af2fad9473
2 changed files with 4 additions and 7 deletions

View File

@@ -261,6 +261,7 @@ class CommandInteraction extends Interaction {
*/
_createOptionsCollection(options, resolved) {
const optionsCollection = new Collection();
if (typeof options === 'undefined') return optionsCollection;
for (const option of options) {
optionsCollection.set(option.name, this.transformOption(option, resolved));
}