From 1b5b18c9b271d9eaae00ffb79b31be38f2c48352 Mon Sep 17 00:00:00 2001 From: xXVevzZXx Date: Wed, 27 Apr 2016 17:50:01 +0200 Subject: [PATCH] Prevent exception while adding variables to gamemodes --- .../src/nautilus/game/arcade/Arcade.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java index 25107556e..1b6a875fe 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java @@ -307,10 +307,19 @@ public class Arcade extends JavaPlugin config.GameModeMods.put(mode, new HashMap<>()); - for(String varSet : mods.split(";")) + if(mods.contains(";")) { - String var = varSet.split("=")[0]; - String value = varSet.split("=")[1]; + for(String varSet : mods.split(";")) + { + String var = varSet.split("=")[0]; + String value = varSet.split("=")[1]; + config.GameModeMods.get(mode).put(var, value); + } + } + else + { + String var = mods.split("=")[0]; + String value = mods.split("=")[1]; config.GameModeMods.get(mode).put(var, value); } }