Clear service variable when onCreate() fails to start foreground service

Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-07 15:53:23 +00:00
parent 5aabb40c48
commit 2297a72e29
@@ -92,6 +92,9 @@ public final class FetchForegroundService extends Service {
startForeground(NotificationCenter.ID_FETCH, notification);
} catch (Exception e) {
Log.w(TAG, "Failed to start foreground service", e);
synchronized (SERVICE_LOCK) {
service = null;
}
stopSelf();
return;
}