Fix possible NPE

This commit is contained in:
Stephen Paul Weber 2024-03-14 00:58:29 +01:00 committed by Arne
parent cd3774b3dc
commit 0aa9b9c47d

View file

@ -403,7 +403,10 @@ public class ConversationsOverviewFragment extends XmppFragment {
@Override
public boolean onContextItemSelected(MenuItem item) {
int pos = ((AdapterContextMenuInfo) item.getMenuInfo()).position;
final var info = ((AdapterContextMenuInfo) item.getMenuInfo());
if (info == null) return false;
int pos = info.position;
if (conversations == null || conversations.size() <= pos || pos < 0) return false;
Conversation conversation = conversations.get(pos);