Fix an issue with PixelFed

This commit is contained in:
Thomas 2020-05-08 11:34:49 +02:00
parent b035fb96ef
commit d32f05df9f
1 changed files with 2 additions and 2 deletions

View File

@ -553,11 +553,11 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
} else if (status.getMedia_attachments() != null) { } else if (status.getMedia_attachments() != null) {
holder.art_media.setVisibility(View.VISIBLE); holder.art_media.setVisibility(View.VISIBLE);
holder.imageSlider.setVisibility(View.GONE); holder.imageSlider.setVisibility(View.GONE);
if (status.getMedia_attachments().get(0).getType().toLowerCase().equals("video")) { if (status.getMedia_attachments().get(0).getType() != null && status.getMedia_attachments().get(0).getType().toLowerCase().equals("video")) {
holder.art_media_play.setVisibility(View.VISIBLE); holder.art_media_play.setVisibility(View.VISIBLE);
} }
String url; String url;
if (status.getMedia_attachments().get(0).getPreview_url().endsWith("no-preview.png")) { if (status.getMedia_attachments().get(0).getPreview_url() != null && status.getMedia_attachments().get(0).getPreview_url().endsWith("no-preview.png")) {
url = status.getMedia_attachments().get(0).getUrl(); url = status.getMedia_attachments().get(0).getUrl();
} else { } else {
url = status.getMedia_attachments().get(0).getPreview_url(); url = status.getMedia_attachments().get(0).getPreview_url();