Prevent crash

This commit is contained in:
M66B 2024-04-13 09:24:01 +02:00
parent ee9b5aa901
commit 6422b7924f
1 changed files with 7 additions and 2 deletions

View File

@ -201,8 +201,13 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (isBackgroundService(this))
stopForeground(true);
else
startForeground(NotificationHelper.NOTIFICATION_SYNCHRONIZE,
getNotificationService(null, null));
try {
startForeground(NotificationHelper.NOTIFICATION_SYNCHRONIZE,
getNotificationService(null, null));
} catch (Throwable ex) {
Log.e(ex);
stopSelf();
}
isOptimizing = Boolean.FALSE.equals(Helper.isIgnoringOptimizations(this));