From 1106595cc364aa5e85438de678d095263ee6ceb8 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 3 Jul 2023 11:55:26 -0500 Subject: [PATCH] index must be <= size --- .../siacs/conversations/ui/ConversationsOverviewFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java index 79dcb90e0..227da6194 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java @@ -371,9 +371,9 @@ public class ConversationsOverviewFragment extends XmppFragment { @Override public boolean onContextItemSelected(MenuItem item) { int pos = ((AdapterContextMenuInfo) item.getMenuInfo()).position; - if (conversations == null || conversations.size() < pos || pos < 0) return false; + if (conversations == null || conversations.size() <= pos || pos < 0) return false; - Conversation conversation = conversations.get(((AdapterContextMenuInfo) item.getMenuInfo()).position); + Conversation conversation = conversations.get(pos); ConversationFragment fragment = new ConversationFragment(); fragment.setHasOptionsMenu(false); fragment.onAttach(activity); -- 2.45.2