From a1b2887bf3cc18d5c21c61be92db1a58128dbde9 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Tue, 28 Aug 2018 11:52:26 -0700 Subject: [PATCH] Fixed off-by-one crash when navigating to message from FTS. Related to #8145 --- src/org/thoughtcrime/securesms/ConversationFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/ConversationFragment.java b/src/org/thoughtcrime/securesms/ConversationFragment.java index 96a7b468f1..4c5069f488 100644 --- a/src/org/thoughtcrime/securesms/ConversationFragment.java +++ b/src/org/thoughtcrime/securesms/ConversationFragment.java @@ -465,7 +465,7 @@ public class ConversationFragment extends Fragment int limit = args.getInt(KEY_LIMIT, PARTIAL_CONVERSATION_LIMIT); int offset = 0; - if (limit != 0 && startingPosition > limit) { + if (limit != 0 && startingPosition >= limit) { offset = Math.max(startingPosition - (limit / 2) + 1, 0); startingPosition -= offset - 1; }