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"));
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);
}