resolves NPE in QueueListAdapter

This commit is contained in:
Tom Hennen 2015-08-05 18:06:27 -04:00
parent 8e2b3371e1
commit d1972ad0e6
1 changed files with 7 additions and 2 deletions

View File

@ -155,14 +155,19 @@ public class QueueListAdapter extends BaseAdapter {
holder.butSecondary.setTag(item); holder.butSecondary.setTag(item);
holder.butSecondary.setOnClickListener(secondaryActionListener); 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) Glide.with(context)
.load(item.getImageUri()) .load(item.getImageUri())
.diskCacheStrategy(DiskCacheStrategy.SOURCE) .diskCacheStrategy(DiskCacheStrategy.SOURCE)
.fitCenter() .fitCenter()
.dontAnimate() .dontAnimate()
.into(new CoverTarget(item.getFeed().getImageUri(), holder.placeholder, holder.cover)); .into(new CoverTarget(feedImageUri, holder.placeholder, holder.cover));
return convertView; return convertView;
} }