diff --git a/libs/libRefTools.jar b/libs/libRefTools.jar index 02b5c30..99f8e4d 100644 Binary files a/libs/libRefTools.jar and b/libs/libRefTools.jar differ diff --git a/src/Launcher/Main.java b/src/Launcher/Main.java index fe0277e..9757f14 100644 --- a/src/Launcher/Main.java +++ b/src/Launcher/Main.java @@ -191,7 +191,7 @@ public class Main extends Application { Stage login = new Stage(); login.initModality(Modality.APPLICATION_MODAL); login.initStyle(StageStyle.UNDECORATED); - Pane minecraftlogin = (Pane) Tabs.load("instance_userinfo"); + Pane minecraftlogin = (Pane) Tabs.reloadTab("instance_userinfo"); login.setScene(new Scene(minecraftlogin, 300, 308)); login.show(); login.setResizable(false); diff --git a/src/Launcher/Tabs.java b/src/Launcher/Tabs.java index 0c67337..c17347d 100644 --- a/src/Launcher/Tabs.java +++ b/src/Launcher/Tabs.java @@ -33,10 +33,10 @@ public class Tabs { URL file = Main.class.getResource("/assets/layout/"+fileName); try { final boolean[] b = {false}; - loaded.stream().filter(p -> p.getKey().equals(file)).forEach(p->b[0]=true); + loaded.stream().filter(p ->p!=null && p.getKey().equals(file)).forEach(p->b[0]=true); if(!b[0]) loaded.add(new Pair<>(file, FXMLLoader.load(file))); // Load file if it isn't already loaded final Node[] p1 = new Node[]{new Pane()}; - loaded.stream().filter(p->p.getKey().equals(file)).forEach(p->p1[0]=p.getValue()); + loaded.stream().filter(p->p!=null && p.getKey().equals(file)).forEach(p->p1[0]=p.getValue()); return p1[0]; } catch (IOException e) { e.printStackTrace(); @@ -67,7 +67,7 @@ public class Tabs { public static void unloadTab(String fileName){ if(!fileName.endsWith(".fxml")) fileName+=".fxml"; URL file = Main.class.getResource("/assets/layout/"+fileName); - loaded.stream().filter(p->p.getKey().equals(file)).forEach(loaded::remove); + loaded.stream().filter(p->p!=null && p.getKey().equals(file)).forEach(loaded::remove); } /**