mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Prevent crash
This commit is contained in:
parent
1657d1a836
commit
f619dd09a3
2 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue