From 84f45986e38f4eb86e1afd0e3e4ecab153c0a3f6 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 31 Mar 2020 12:02:28 +0200 Subject: Fixed crashing DownloadService --- .../danoeh/antennapod/core/service/download/DownloadService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index 1251dd96e..28523ef0a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -549,7 +549,7 @@ public class DownloadService extends Service { } /** - * Check if there's something else to download, otherwise stop + * Check if there's something else to download, otherwise stop. */ private void queryDownloads() { Log.d(TAG, numberOfDownloads.get() + " downloads left"); @@ -557,7 +557,11 @@ public class DownloadService extends Service { if (numberOfDownloads.get() <= 0 && DownloadRequester.getInstance().hasNoDownloads()) { Log.d(TAG, "Number of downloads is " + numberOfDownloads.get() + ", attempting shutdown"); stopSelf(); - notificationUpdater.run(); + if (notificationUpdater != null) { + notificationUpdater.run(); + } else { + Log.d(TAG, "Skipping notification update"); + } } else { setupNotificationUpdater(); Notification notification = notificationManager.updateNotifications( -- cgit v1.2.3