Fix IndexOutOfBoundsException in CommentsRecyclerViewAdapter

This commit is contained in:
Balazs Toldi 2023-08-25 09:36:37 +02:00
parent 143bc5e1b6
commit 6542859892
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58

View File

@ -672,10 +672,12 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
// mVisibleComments.get(parentPosition).removeMoreChildrenIds();
if (position != -1) {
mVisibleComments.remove(position);
if (mIsSingleCommentThreadMode) {
mVisibleComments.remove(position - 1);
notifyItemRemoved(position + 1);
} else {
mVisibleComments.remove(position);
notifyItemRemoved(position);
}
List<Comment> trulyNewComments = new ArrayList<>();