Skip to content

Commit

Permalink
Fixed menu commands with one argument not parsed correctly (#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Mar 4, 2022
1 parent 6441762 commit 5135660
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -134,13 +134,13 @@ public void dispatchSubCommand(CommandSender sender, String subCommand) {

@Override
public void dispatchSubCommand(CommandSender sender, String subCommand, String args) {
String[] argsSplit = args.split(" ");
String[] commandArguments;

if (!args.contains(" ")) {
if (argsSplit.length == 1 && argsSplit[0].isEmpty()) {
commandArguments = new String[1];
commandArguments[0] = subCommand;
} else {
String[] argsSplit = args.split(" ");
commandArguments = new String[argsSplit.length + 1];
commandArguments[0] = subCommand;
System.arraycopy(argsSplit, 0, commandArguments, 1, argsSplit.length);
Expand Down

0 comments on commit 5135660

Please sign in to comment.