v0.8.0b: fixed error printouts being eaten if game fails to start
This commit is contained in:
parent
1daea3acb7
commit
55340817e8
|
@ -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 ){
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user