Hopefully stop memory leak

merge-requests/1/merge
Bsian 2019-11-02 00:32:58 +00:00
parent 9b85bea477
commit c7e036062f
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 5 additions and 1 deletions

View File

@ -66,10 +66,14 @@ export default class Util {
parentLabel += `${resolvedCommand.name} `; parentLabel += `${resolvedCommand.name} `;
resolvedCommand = resolvedCommand.subcommands.get(args[0]); args.shift(); resolvedCommand = resolvedCommand.subcommands.get(args[0]); args.shift();
} else { } else {
for (const subCmd of resolvedCommand.subcommands.toArray()) { const subcommandArray = resolvedCommand.subcommands.toArray();
for (const subCmd of subcommandArray) {
if (subCmd.aliases.includes(args[0])) { if (subCmd.aliases.includes(args[0])) {
parentLabel += `${resolvedCommand.name} `; resolvedCommand = subCmd; args.shift(); break; parentLabel += `${resolvedCommand.name} `; resolvedCommand = subCmd; args.shift(); break;
} }
if (subcommandArray.findIndex((v) => v === subCmd) === subcommandArray.length - 1) {
hasSubCommands = false; break;
}
} }
} }
} }