From fadd4ac61e2cb3ee33ca3745ba07e8927f859b7b Mon Sep 17 00:00:00 2001
From: Greyson Parrelli <greyson@signal.org>
Date: Fri, 22 Apr 2022 14:50:23 -0400
Subject: [PATCH] Fix possible index out of bounds exception in
 ConversationAdapter.

If we're deferring to super.getItem(), then we should be guarding with
super.getItemCount().
---
 .../securesms/conversation/ConversationAdapter.java             | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationAdapter.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationAdapter.java
index 59b97475a8..6451506225 100644
--- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationAdapter.java
+++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationAdapter.java
@@ -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.");
-- 
GitLab