Fixes a NullPointerException thrown when the profiles file does not exist

This commit is contained in:
Kristian Knarvik 2020-08-17 12:39:29 +02:00
parent a5db6b3a70
commit ba9b192790

View File

@ -469,10 +469,9 @@ public class Profile implements java.io.Serializable {
addProfile("Default");
}
} catch (FileNotFoundException | NoSuchElementException e) {
serverLauncherGui.showMessage("A profiles file was not found. Default profile was created.");
try {
serverLauncherGui = new ServerLauncherGUI();
serverLauncherGui.showMessage("Failed to load ServerLauncherGUI messages. The ServerLauncherGUI can't be shown.");
serverLauncherGui.showMessage("A profiles file was not found. Default profile was created.");
} catch (IOException ex) {
ex.printStackTrace();
}