Fix Index out of bound error in completions for no parameter commands

This commit is contained in:
chickeneer
2019-08-06 21:28:47 -05:00
parent 91e7b9d39b
commit ec4816fe1b
@@ -685,7 +685,7 @@ public abstract class BaseCommand {
* @return All results to complete the command.
*/
private List<String> completeCommand(CommandIssuer issuer, RegisteredCommand cmd, String[] args, String commandLabel, boolean isAsync) {
if (!cmd.hasPermission(issuer) || args.length == 0) {
if (!cmd.hasPermission(issuer) || args.length == 0 || cmd.parameters.length == 0) {
return Collections.emptyList();
}