aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
index 92996de9..14f53a2d 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
@@ -696,8 +696,10 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
}
}
- mVisibleComments.get(placeholderPosition).setLoadingMoreChildren(false);
- mVisibleComments.get(placeholderPosition).setLoadMoreChildrenFailed(true);
+ if (placeholderPosition >= mVisibleComments.size() || placeholderPosition < 0) {
+ mVisibleComments.get(placeholderPosition).setLoadingMoreChildren(false);
+ mVisibleComments.get(placeholderPosition).setLoadMoreChildrenFailed(true);
+ }
((LoadMoreChildCommentsViewHolder) holder).placeholderTextView.setText(R.string.comment_load_more_comments_failed);
}