Added argument validation in SetLineCMD to prevent index errors (#155)

This commit is contained in:
Alex
2025-11-21 15:00:55 +01:00
committed by GitHub
parent 529821ced6
commit 1919b3da4d

View File

@@ -76,6 +76,11 @@ public class SetLineCMD implements Subcommand {
index--; index--;
if (args.length < 5) {
MessageHelper.error(player, "Please provide text for the line");
return false;
}
String text = ""; String text = "";
for (int i = 4; i < args.length; i++) { for (int i = 4; i < args.length; i++) {
text += args[i] + " "; text += args[i] + " ";