9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00

Fix: ArrayIndexOutOfBoundsException in BotCommand (#420)

This commit is contained in:
YANAN
2025-02-25 13:24:02 +08:00
committed by GitHub
parent df47882b72
commit 07b429ed2d

View File

@@ -94,8 +94,8 @@ public class BotCommand extends Command {
}
}
if (args[0].equals("remove") && args.length >= 3) {
if (!Objects.equals(args[3], "cancel")) {
if (args[0].equals("remove") && args.length >= 4) {
if (!Objects.equals(args[2], "cancel")) {
switch (args.length) {
case 4 -> list.add("[minute]");
case 5 -> list.add("[second]");