Fix out of bounds crash (Cheogram)

This commit is contained in:
Arne 2023-05-20 01:20:41 +02:00
parent 8b62c9c661
commit dcac523a07

View file

@ -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);