Skip to content

Commit

Permalink
Throw error when param count max is less than min
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed May 7, 2024
1 parent 2c9bb43 commit abce198
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ public void execute(final Player admin, final List<String> args) {
final int minparams = getMinParams();
final int maxparams = getMaxParams();
if (maxparams > -1 && maxparams < minparams) {
admin.sendPrivateText(NotificationType.ERROR, "Maximum parameters ("
+ maxparams + ") is less than minimum parameters ("
+ minparams + ").");
return;
throw new IllegalArgumentException("Maximum parameters (" + maxparams
+ ") is less than minimum parameters (" + minparams + ").");
}
final int argc = args.size();
if (argc > 0 && Arrays.asList("-?", "-h", "-help", "--help")
Expand Down

0 comments on commit abce198

Please sign in to comment.