Skip to content

Commit

Permalink
Fix IllegalArgumentException in CommandTicTacToeAccept::onTabComplete
Browse files Browse the repository at this point in the history
  • Loading branch information
lscgh committed Feb 6, 2024
1 parent 83fee01 commit 8f7867b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public List<String> onTabComplete(CommandSender sender, Command command, String

ArrayList<String> argList = new ArrayList<String>();
for(String arg: args) argList.add(arg);
argList.removeIf((arg) -> arg.isEmpty() && !CommandTicTacToeAccept.containsNonEmptyString(argList.subList(0, argList.indexOf(arg) - 1)));
argList.removeIf((arg) -> arg.isEmpty() && !CommandTicTacToeAccept.containsNonEmptyString(argList.subList(0, Math.max(0, argList.indexOf(arg) - 1))));

if(argList.size() > CommandTicTacToeAccept.ARG_COUNT) return new ArrayList<String>();

Expand Down

0 comments on commit 8f7867b

Please sign in to comment.