diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java index f64765a86..9d22348d5 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java @@ -329,7 +329,10 @@ public class ConversationsOverviewFragment extends XmppFragment { final MenuItem menuOngoingCall = menu.findItem(R.id.action_ongoing_call); final MenuItem menuTogglePinned = menu.findItem(R.id.action_toggle_pinned); - Conversation conversation = conversations.get(((AdapterView.AdapterContextMenuInfo) menuInfo).position); + if (menuInfo == null) return; + int pos = ((AdapterView.AdapterContextMenuInfo) menuInfo).position; + if (pos < 0) return; + Conversation conversation = conversations.get(pos); if (conversation != null) { if (conversation.getMode() == Conversation.MODE_MULTI) { menuContactDetails.setVisible(false);