WhitelistCommand: fixed silence on unknown subcommand

This commit is contained in:
Dylan K. Taylor 2020-06-20 23:05:39 +01:00
parent 88c1014f03
commit 7c7e4f2093

View File

@ -49,10 +49,6 @@ class WhitelistCommand extends VanillaCommand{
return true; return true;
} }
if(count($args) === 0 or count($args) > 2){
throw new InvalidCommandSyntaxException();
}
if(count($args) === 1){ if(count($args) === 1){
if($this->badPerm($sender, strtolower($args[0]))){ if($this->badPerm($sender, strtolower($args[0]))){
return false; return false;
@ -112,7 +108,7 @@ class WhitelistCommand extends VanillaCommand{
} }
} }
return true; throw new InvalidCommandSyntaxException();
} }
private function badPerm(CommandSender $sender, string $subcommand) : bool{ private function badPerm(CommandSender $sender, string $subcommand) : bool{