Fix possible index out of bounds exception in ConversationAdapter.

If we're deferring to super.getItem(), then we should be guarding with
super.getItemCount().
This commit is contained in:
Greyson Parrelli 2022-04-22 14:50:23 -04:00 committed by Alex Hart
parent d0c14895d0
commit fadd4ac61e

View file

@ -377,7 +377,7 @@ public class ConversationAdapter
pagingController.onDataNeededAroundIndex(position);
}
if (position < getItemCount()) {
if (position < super.getItemCount()) {
return super.getItem(position);
} else {
Log.d(TAG, "Could not access corrected position " + position + " as it is out of bounds.");