From 5bfd4ec6e5f1ccd677af49ddfc9175ca37b08410 Mon Sep 17 00:00:00 2001 From: levischnorr Date: Tue, 6 Feb 2024 11:23:13 +0100 Subject: [PATCH] Don't use getLast() on an ArrayList (very dangerous) --- .../src/main/java/mavenmcserver/command/CommandTicTacToe.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java b/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java index 7a8be28..04e4439 100644 --- a/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java +++ b/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java @@ -177,7 +177,7 @@ public List onTabComplete(CommandSender sender, Command command, String } ArrayList filteredCompletions = new ArrayList(); - StringUtil.copyPartialMatches(argList.getLast(), completions, filteredCompletions); + StringUtil.copyPartialMatches(argList.get(argList.size() - 1), completions, filteredCompletions); return filteredCompletions; }