1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-24 15:11:03 +00:00

Prevent crash

This commit is contained in:
M66B 2019-04-05 14:38:54 +02:00
parent 1657d1a836
commit f619dd09a3
2 changed files with 10 additions and 2 deletions

View file

@ -1500,7 +1500,11 @@ class Core {
boolean badge = prefs.getBoolean("badge", true);
Widget.update(context, messages.size());
ShortcutBadger.applyCount(context, badge ? messages.size() : 0);
try {
ShortcutBadger.applyCount(context, badge ? messages.size() : 0);
} catch (Throwable ex) {
Log.e(ex);
}
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

View file

@ -163,7 +163,11 @@ public class ServiceSynchronize extends LifecycleService {
cm.unregisterNetworkCallback(networkCallback);
Widget.update(this, -1);
ShortcutBadger.applyCount(this, 0);
try {
ShortcutBadger.applyCount(this, 0);
} catch (Throwable ex) {
Log.e(ex);
}
WorkerCleanup.cancel();