Skip to content

Commit

Permalink
Don't use getLast() on an ArrayList (very dangerous)
Browse files Browse the repository at this point in the history
  • Loading branch information
lscgh committed Feb 6, 2024
1 parent d3e2574 commit 5bfd4ec
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public List<String> onTabComplete(CommandSender sender, Command command, String
}

ArrayList<String> filteredCompletions = new ArrayList<String>();
StringUtil.copyPartialMatches(argList.getLast(), completions, filteredCompletions);
StringUtil.copyPartialMatches(argList.get(argList.size() - 1), completions, filteredCompletions);

return filteredCompletions;
}
Expand Down

0 comments on commit 5bfd4ec

Please sign in to comment.