Merge pull request #1625 from mfietz/issue/1623-audioplayer-npe

Audioplayer: Prevent onMediaChanged() NPE
This commit is contained in:
Martin Fietz 2016-01-28 13:33:12 +01:00
commit b1aec69b2c
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ public class ChaptersFragment extends ListFragment implements AudioplayerContent
this.media = media;
adapter.setMedia(media);
adapter.notifyDataSetChanged();
if(media.getChapters() == null) {
if(media == null || media.getChapters() == null || media.getChapters().size() == 0) {
setEmptyText(getString(R.string.no_items_label));
} else {
setEmptyText(null);