diff options
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostGalleryTypeImageRecyclerViewAdapter.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostGalleryTypeImageRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostGalleryTypeImageRecyclerViewAdapter.java index 41b00634..16447653 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostGalleryTypeImageRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostGalleryTypeImageRecyclerViewAdapter.java @@ -118,7 +118,7 @@ public class PostGalleryTypeImageRecyclerViewAdapter extends RecyclerView.Adapte } private void loadImage(ImageViewHolder holder) { - if (galleryImages == null) { + if (galleryImages == null || galleryImages.isEmpty()) { return; } @@ -146,6 +146,10 @@ public class PostGalleryTypeImageRecyclerViewAdapter extends RecyclerView.Adapte } private void loadCaptionPreview(ImageViewHolder holder) { + if (galleryImages == null || galleryImages.isEmpty()) { + return; + } + String previewCaption = galleryImages.get(holder.getBindingAdapterPosition()).caption; String previewCaptionUrl = galleryImages.get(holder.getBindingAdapterPosition()).captionUrl; boolean previewCaptionIsEmpty = TextUtils.isEmpty(previewCaption); |