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 ){

View File

@ -79,7 +79,7 @@ public class DesktopLauncher {
"If you could, please email this error message to the developer (Evan@ShatteredPixel.com):\n\n" +
exceptionMsg,
"ok", "error", false );
Gdx.app.exit();
if (Gdx.app != null) Gdx.app.exit();
}
});