mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 13:44:40 +00:00
Prevent crash
This commit is contained in:
parent
f439458899
commit
04a2a12546
1 changed files with 11 additions and 3 deletions
|
@ -134,8 +134,12 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
@Override
|
||||
public void onChanged(@Nullable TupleAccountStats stats) {
|
||||
if (stats != null && !stats.equals(lastStats)) {
|
||||
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
nm.notify(Helper.NOTIFICATION_SYNCHRONIZE, getNotificationService(stats).build());
|
||||
try {
|
||||
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
nm.notify(Helper.NOTIFICATION_SYNCHRONIZE, getNotificationService(stats).build());
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
|
||||
if (oneshot && stats.operations > 0)
|
||||
onOneshot(true);
|
||||
|
@ -163,7 +167,11 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
|
||||
@Override
|
||||
public void onChanged(List<TupleMessageEx> messages) {
|
||||
Core.notifyMessages(ServiceSynchronize.this, notifying, messages);
|
||||
try {
|
||||
Core.notifyMessages(ServiceSynchronize.this, notifying, messages);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue