Fixes the software crashing if an old configuration is used
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good

This commit is contained in:
Kristian Knarvik 2021-08-03 14:00:02 +02:00
parent c9c2a1b43b
commit f8ba6e7ad1

View File

@ -310,8 +310,12 @@ public class ServerLauncherController {
this.downloadAllJars = Boolean.parseBoolean(loadedData.get("downloadAllJars")); this.downloadAllJars = Boolean.parseBoolean(loadedData.get("downloadAllJars"));
if (!silent) { if (!silent) {
this.serverLauncherGUI = new ServerLauncherGUI(Integer.parseInt(loadedData.get("guiWidth")), if (loadedData.get("guiWidth") != null && loadedData.get("guiHeight") != null) {
Integer.parseInt(loadedData.get("guiHeight"))); this.serverLauncherGUI = new ServerLauncherGUI(Integer.parseInt(loadedData.get("guiWidth")),
Integer.parseInt(loadedData.get("guiHeight")));
} else {
this.serverLauncherGUI = new ServerLauncherGUI();
}
} else { } else {
this.serverLauncherGUI = new ServerLauncherGUI(true); this.serverLauncherGUI = new ServerLauncherGUI(true);
} }