Check media and mediaItem for null as suggested by mfietz

This commit is contained in:
Meir Schwarz 2017-04-10 15:27:24 -07:00
parent 831166cfb2
commit 6e8baf839a
1 changed files with 3 additions and 1 deletions

View File

@ -405,9 +405,11 @@ public class PlaybackService extends MediaBrowserServiceCompat {
Long feedId = Long.parseLong(parentId.split(":")[1]); Long feedId = Long.parseLong(parentId.split(":")[1]);
List<FeedItem> feedItems = DBReader.getFeedItemList(DBReader.getFeed(feedId)); List<FeedItem> feedItems = DBReader.getFeedItemList(DBReader.getFeed(feedId));
for (FeedItem feedItem: feedItems) { for (FeedItem feedItem: feedItems) {
if(feedItem.getMedia() != null && feedItem.getMedia().getMediaItem() != null) {
mediaItems.add(feedItem.getMedia().getMediaItem()); mediaItems.add(feedItem.getMedia().getMediaItem());
} }
} }
}
result.sendResult(mediaItems); result.sendResult(mediaItems);
} }