From 4af3be7aa44e2fa8b872a155af5882d4ab5a63b0 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 7 Nov 2021 13:11:05 +0100 Subject: [PATCH] Fix crash when sync provider is null --- .../java/de/danoeh/antennapod/core/sync/SyncService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java b/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java index b2a474598..82896382d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java @@ -346,7 +346,10 @@ public class SyncService extends Worker { private ISyncService getActiveSyncProvider() { String selectedSyncProviderKey = SynchronizationSettings.getSelectedSyncProviderKey(); SynchronizationProviderViewData selectedService = SynchronizationProviderViewData - .valueOf(selectedSyncProviderKey); + .fromIdentifier(selectedSyncProviderKey); + if (selectedService == null) { + return null; + } switch (selectedService) { case GPODDER_NET: return new GpodnetService(AntennapodHttpClient.getHttpClient(),