From d1972ad0e630ee40a625507ef2b7a5a3321b8902 Mon Sep 17 00:00:00 2001 From: Tom Hennen Date: Wed, 5 Aug 2015 18:06:27 -0400 Subject: [PATCH] resolves NPE in QueueListAdapter --- .../de/danoeh/antennapod/adapter/QueueListAdapter.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/QueueListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/QueueListAdapter.java index 73d7c9252..b14268cf6 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/QueueListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/QueueListAdapter.java @@ -155,14 +155,19 @@ public class QueueListAdapter extends BaseAdapter { holder.butSecondary.setTag(item); holder.butSecondary.setOnClickListener(secondaryActionListener); - Log.d(TAG, item.getFeed().getImageUri().toString()); + Uri feedImageUri = item.getFeed().getImageUri(); + if (feedImageUri != null) { + Log.d(TAG, item.getFeed().getImageUri().toString()); + } else { + Log.d(TAG, "Feed has null image uri"); + } Glide.with(context) .load(item.getImageUri()) .diskCacheStrategy(DiskCacheStrategy.SOURCE) .fitCenter() .dontAnimate() - .into(new CoverTarget(item.getFeed().getImageUri(), holder.placeholder, holder.cover)); + .into(new CoverTarget(feedImageUri, holder.placeholder, holder.cover)); return convertView; }