Fix an ArrayIndexOutOfBoundsException in CommentsRecyclerViewAdapter.

This commit is contained in:
Alex Ning 2021-08-24 20:59:32 +08:00
parent 79e4b13c82
commit 386b6e22ca

View File

@ -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);
}