Prevent NPE
This commit is contained in:
parent
aab9f51077
commit
4a6b630e56
|
@ -1,6 +1,7 @@
|
|||
package de.danoeh.antennapod.core.feed;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
@ -269,6 +270,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
|
|||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public FeedMedia getMedia() {
|
||||
return media;
|
||||
}
|
||||
|
|
|
@ -301,7 +301,10 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||
List<MediaSessionCompat.QueueItem> queueItems = new ArrayList<>();
|
||||
try {
|
||||
for (FeedItem feedItem : taskManager.getQueue()) {
|
||||
queueItems.add(new MediaSessionCompat.QueueItem(feedItem.getMedia().getMediaItem().getDescription(), feedItem.getId()));
|
||||
if(feedItem.getMedia() != null) {
|
||||
MediaDescriptionCompat mediaDescription = feedItem.getMedia().getMediaItem().getDescription();
|
||||
queueItems.add(new MediaSessionCompat.QueueItem(mediaDescription, feedItem.getId()));
|
||||
}
|
||||
}
|
||||
mediaSession.setQueue(queueItems);
|
||||
} catch (InterruptedException e) {
|
||||
|
|
Loading…
Reference in New Issue