From f8ba6e7ad1f3f1fbb458ea031dc81ff42743c1ee Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Tue, 3 Aug 2021 14:00:02 +0200 Subject: [PATCH] Fixes the software crashing if an old configuration is used --- .../profile/ServerLauncherController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/knarcraft/minecraftserverlauncher/profile/ServerLauncherController.java b/src/main/java/net/knarcraft/minecraftserverlauncher/profile/ServerLauncherController.java index a427597..5237002 100644 --- a/src/main/java/net/knarcraft/minecraftserverlauncher/profile/ServerLauncherController.java +++ b/src/main/java/net/knarcraft/minecraftserverlauncher/profile/ServerLauncherController.java @@ -310,8 +310,12 @@ public class ServerLauncherController { this.downloadAllJars = Boolean.parseBoolean(loadedData.get("downloadAllJars")); if (!silent) { - this.serverLauncherGUI = new ServerLauncherGUI(Integer.parseInt(loadedData.get("guiWidth")), - Integer.parseInt(loadedData.get("guiHeight"))); + if (loadedData.get("guiWidth") != null && loadedData.get("guiHeight") != null) { + this.serverLauncherGUI = new ServerLauncherGUI(Integer.parseInt(loadedData.get("guiWidth")), + Integer.parseInt(loadedData.get("guiHeight"))); + } else { + this.serverLauncherGUI = new ServerLauncherGUI(); + } } else { this.serverLauncherGUI = new ServerLauncherGUI(true); }