v0.8.0b: fixed error printouts being eaten if game fails to start

This commit is contained in:
Evan Debenham
2020-05-04 16:09:04 -04:00
parent 1daea3acb7
commit 55340817e8
2 changed files with 11 additions and 2 deletions

View File

@@ -249,7 +249,16 @@ public class Game implements ApplicationListener {
}
public static void reportException( Throwable tr ) {
if (instance != null) instance.logException(tr);
if (instance != null) {
instance.logException(tr);
} else {
//fallback if error happened in initialization
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
tr.printStackTrace(pw);
pw.flush();
System.err.println(sw.toString());
}
}
protected void logException( Throwable tr ){