mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 04:35:50 +01:00
Add arglength checking for /npc command clearerror
This commit is contained in:
parent
bbf7ca2f98
commit
353699fe80
@ -441,6 +441,10 @@ public class NPCCommands {
|
||||
throw new CommandException(CommandMessages.INVALID_NUMBER);
|
||||
}
|
||||
} else if (action.equalsIgnoreCase("clearerror")) {
|
||||
if (args.argsLength() < 3)
|
||||
throw new CommandException(Messages.NPC_COMMAND_INVALID_ERROR_MESSAGE,
|
||||
Util.listValuesPretty(CommandTraitError.values()));
|
||||
|
||||
CommandTraitError which = Util.matchEnum(CommandTraitError.values(), args.getString(2));
|
||||
if (which == null)
|
||||
throw new CommandException(Messages.NPC_COMMAND_INVALID_ERROR_MESSAGE,
|
||||
|
Loading…
Reference in New Issue
Block a user