diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java index 68ea4db91..3f5edce8e 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java @@ -387,6 +387,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; + Conversation conversation = conversations.get(((AdapterContextMenuInfo) item.getMenuInfo()).position); ConversationFragment fragment = new ConversationFragment(); fragment.setHasOptionsMenu(false);