Check for blank URL before loading image

This commit is contained in:
daniel oeh 2014-10-05 20:14:29 +02:00
parent 027bebd6a9
commit 273ff588d9
2 changed files with 9 additions and 5 deletions

View File

@ -122,7 +122,7 @@ public class DefaultOnlineFeedViewActivity extends OnlineFeedViewActivity {
subscribeButton = (Button) header.findViewById(R.id.butSubscribe);
if (feed.getImage() != null) {
if (feed.getImage() != null && StringUtils.isNoneBlank(feed.getImage().getDownload_url())) {
PicassoProvider.getDefaultPicassoInstance(this)
.load(feed.getImage().getDownload_url())
.fit()

View File

@ -8,6 +8,8 @@ import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
import de.danoeh.antennapod.R;
@ -48,10 +50,12 @@ public class PodcastListAdapter extends ArrayAdapter<GpodnetPodcast> {
holder.title.setText(podcast.getTitle());
holder.description.setText(podcast.getDescription());
PicassoProvider.getDefaultPicassoInstance(convertView.getContext())
.load(podcast.getLogoUrl())
.fit()
.into(holder.image);
if (StringUtils.isNoneBlank(podcast.getLogoUrl())) {
PicassoProvider.getDefaultPicassoInstance(convertView.getContext())
.load(podcast.getLogoUrl())
.fit()
.into(holder.image);
}
return convertView;
}