From 18f98ed79db4056491f53b3539b62c9142f6c81d Mon Sep 17 00:00:00 2001 From: ezTxmMC Date: Thu, 2 Jan 2025 14:37:58 +0100 Subject: [PATCH] fixed out of bounds --- .../lobbyserver/console/JLineConsole.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/twoweeksmc/lobbyserver/console/JLineConsole.java b/src/main/java/com/twoweeksmc/lobbyserver/console/JLineConsole.java index 81e7749..c5d1993 100644 --- a/src/main/java/com/twoweeksmc/lobbyserver/console/JLineConsole.java +++ b/src/main/java/com/twoweeksmc/lobbyserver/console/JLineConsole.java @@ -62,31 +62,35 @@ public void start() { switch (command) { case "clear" -> this.clear(); case "create" -> { + if (args.length < 1) { + this.print("Usage: create server "); + continue; + } switch (args[0].toLowerCase()) { case "server" -> { if (args.length < 2) { this.print("Usage: create server "); - return; + continue; } if (args[1].equalsIgnoreCase("template")) { if (args.length < 3) { this.print("Usage: create server template