Fix NPE, better exception handling on startup

This commit is contained in:
Eiren Rain
2021-07-03 01:54:08 +03:00
parent 172e45db4b
commit 528fb7ca8d
2 changed files with 14 additions and 5 deletions

View File

@@ -19,10 +19,19 @@ public class Main {
e1.printStackTrace();
}
VRServer vrServer = new VRServer();
vrServer.start();
new VRServerGUI(vrServer);
try {
VRServer vrServer = new VRServer();
vrServer.start();
new VRServerGUI(vrServer);
} catch(Throwable e) {
e.printStackTrace();
} finally {
try {
Thread.sleep(2000L);
} catch(InterruptedException e) {
e.printStackTrace();
}
}
}
}

View File

@@ -26,7 +26,7 @@ public enum TrackerBodyPosition {
}
public static TrackerBodyPosition getByDesignation(String designation) {
return byDesignation.get(designation.toLowerCase());
return designation == null ? null : byDesignation.get(designation.toLowerCase());
}
static {