fix chomens bot crsah exploit 2023 working

This commit is contained in:
ChomeNS
2023-04-24 19:27:00 +07:00
parent c04ed184eb
commit f78b422a17
2 changed files with 19 additions and 13 deletions

View File

@@ -70,7 +70,12 @@ public class CommandHandlerPlugin {
public Component executeCommand (String input, CommandContext context, boolean inGame, boolean discord, boolean console, String hash, String ownerHash, MessageReceivedEvent event) {
final String[] splitInput = input.split("\\s+");
final String commandName = splitInput[0];
String commandName;
try {
commandName = splitInput[0];
} catch (ArrayIndexOutOfBoundsException e) {
return Component.text("Empty command").color(NamedTextColor.RED);
}
final Command command = ElementUtilities.findCommand(commands, commandName);