From ec9d631d8d4df732d6288431960bca2bdd2fa4a9 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Mon, 2 Nov 2020 17:10:20 +0100 Subject: [PATCH] Fixed crash when playing from preferences --- .../antennapod/core/feed/util/PlaybackSpeedUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/util/PlaybackSpeedUtils.java b/core/src/main/java/de/danoeh/antennapod/core/feed/util/PlaybackSpeedUtils.java index 0d5ecbb71..d6740994d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/util/PlaybackSpeedUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/util/PlaybackSpeedUtils.java @@ -1,5 +1,6 @@ package de.danoeh.antennapod.core.feed.util; +import android.util.Log; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; @@ -14,6 +15,7 @@ import static de.danoeh.antennapod.core.feed.FeedPreferences.SPEED_USE_GLOBAL; * Utility class to use the appropriate playback speed based on {@link PlaybackPreferences} */ public final class PlaybackSpeedUtils { + private static final String TAG = "PlaybackSpeedUtils"; private PlaybackSpeedUtils() { } @@ -33,8 +35,10 @@ public final class PlaybackSpeedUtils { FeedItem item = ((FeedMedia) media).getItem(); if (item != null) { Feed feed = item.getFeed(); - if (feed != null) { + if (feed != null && feed.getPreferences() != null) { playbackSpeed = feed.getPreferences().getFeedPlaybackSpeed(); + } else { + Log.d(TAG, "Can not get feed specific playback speed: " + feed); } } }