Ignore InternalErrors during app shutdown.

This commit is contained in:
Johannes Mockenhaupt 2019-11-12 13:44:02 +01:00
parent cce3a77a37
commit dc38615ec9
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -129,7 +129,14 @@ public class MainApp extends Application {
sConstraintsChecker = new ConstraintChecker();
sDatabaseHelper = OpenHelperManager.getHelper(sInstance, DatabaseHelper.class);
Thread.setDefaultUncaughtExceptionHandler((thread, ex) -> log.error("Uncaught exception crashing app", ex));
Thread.setDefaultUncaughtExceptionHandler((thread, ex) -> {
if (ex instanceof InternalError) {
// usually the app trying to spawn a thread while being killed
return;
}
log.error("Uncaught exception crashing app", ex);
});
try {
if (FabricPrivacy.fabricEnabled()) {