diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-08-17 17:05:14 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-08-17 17:05:14 +0200 |
commit | 462ff3cadc0c0c25d693b8028d0757cb82f1759e (patch) | |
tree | ef074c7376c3bf8b419be15bdeb3204c31a8ab85 /src/de/danoeh/antennapod/service | |
parent | 46459b7c4393b831b003ffaa438cf027a524d774 (diff) | |
download | AntennaPod-462ff3cadc0c0c25d693b8028d0757cb82f1759e.zip |
PlaybackService crashed when media file was incorrect/not found
Diffstat (limited to 'src/de/danoeh/antennapod/service')
-rw-r--r-- | src/de/danoeh/antennapod/service/PlaybackService.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/de/danoeh/antennapod/service/PlaybackService.java b/src/de/danoeh/antennapod/service/PlaybackService.java index 7c306984c..12c005765 100644 --- a/src/de/danoeh/antennapod/service/PlaybackService.java +++ b/src/de/danoeh/antennapod/service/PlaybackService.java @@ -1282,18 +1282,20 @@ public class PlaybackService extends Service { isPlaying = true; } - Intent i = new Intent(AVRCP_ACTION_PLAYER_STATUS_CHANGED); - i.putExtra("id", 1); - i.putExtra("artist", ""); - i.putExtra("album", media.getFeedTitle()); - i.putExtra("track", media.getEpisodeTitle()); - i.putExtra("playing", isPlaying); - if (queue != null) { - i.putExtra("ListSize", queue.size()); + if (media != null) { + Intent i = new Intent(AVRCP_ACTION_PLAYER_STATUS_CHANGED); + i.putExtra("id", 1); + i.putExtra("artist", ""); + i.putExtra("album", media.getFeedTitle()); + i.putExtra("track", media.getEpisodeTitle()); + i.putExtra("playing", isPlaying); + if (queue != null) { + i.putExtra("ListSize", queue.size()); + } + i.putExtra("duration", media.getDuration()); + i.putExtra("position", media.getPosition()); + sendBroadcast(i); } - i.putExtra("duration", media.getDuration()); - i.putExtra("position", media.getPosition()); - sendBroadcast(i); } /** |