diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-08-24 12:59:32 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-08-24 12:59:32 +0000 |
commit | 386b6e22ca18bb77cfcde9480ca44b11fa2c0a54 (patch) | |
tree | 7a5b75c34f291e320417352a12f7821c019ee1c1 /app/src/main/java/ml/docilealligator | |
parent | 79e4b13c82eac7b4ba2842c625565da199f54f97 (diff) | |
download | infinity-for-reddit-386b6e22ca18bb77cfcde9480ca44b11fa2c0a54.tar infinity-for-reddit-386b6e22ca18bb77cfcde9480ca44b11fa2c0a54.tar.gz infinity-for-reddit-386b6e22ca18bb77cfcde9480ca44b11fa2c0a54.tar.bz2 infinity-for-reddit-386b6e22ca18bb77cfcde9480ca44b11fa2c0a54.tar.lz infinity-for-reddit-386b6e22ca18bb77cfcde9480ca44b11fa2c0a54.tar.xz infinity-for-reddit-386b6e22ca18bb77cfcde9480ca44b11fa2c0a54.tar.zst infinity-for-reddit-386b6e22ca18bb77cfcde9480ca44b11fa2c0a54.zip |
Fix an ArrayIndexOutOfBoundsException in CommentsRecyclerViewAdapter.
Diffstat (limited to 'app/src/main/java/ml/docilealligator')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java | 6 |
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); } |