From f64c89f9d7981f313fb8e1eb8488cbeceee57deb Mon Sep 17 00:00:00 2001 From: levischnorr Date: Thu, 25 Jan 2024 13:39:53 +0100 Subject: [PATCH] Fix crash --- .../main/java/mavenmcserver/command/CommandTicTacToe.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java b/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java index 8d9f0c4..32b832a 100644 --- a/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java +++ b/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java @@ -118,7 +118,11 @@ public GameConfig createGameConfigFromCommand(Player mainPlayer, String args[]) for(int i = 1; i < 5; i++) { try { - integerArguments[i - 1] = Integer.parseInt(args[i]); + if(args.length <= i) { + integerArguments[i - 1] = i == 2 ? 1 : 3; + } else { + integerArguments[i - 1] = Integer.parseInt(args[i]); + } } catch(NumberFormatException e) { throw e; }