From 8399da878faff6f6b649ad4c893f212e3f9beb7b Mon Sep 17 00:00:00 2001 From: Tom Hennen Date: Sat, 27 Jun 2015 10:05:33 -0400 Subject: [PATCH] Guard use of 'media' It can be null in this class, so we should make sure it isn't accessed if it is. fixes AntennaPod/AntennaPod#972 --- .../antennapod/core/util/playback/PlaybackController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java index a0d12d3e7..ba5428b81 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java @@ -555,7 +555,7 @@ public abstract class PlaybackController { * Should be used by classes which implement the OnSeekBarChanged interface. */ public void onSeekBarStopTrackingTouch(SeekBar seekBar, float prog) { - if (playbackService != null) { + if (playbackService != null && media != null) { playbackService.seekTo((int) (prog * media.getDuration())); setupPositionObserver(); }