From e735be323e8691cd09743e36a4b70336d79ff477 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 14 Aug 2019 17:04:31 +0200 Subject: [PATCH] catch npe on participants context menu --- .../eu/siacs/conversations/ui/ConferenceDetailsActivity.java | 5 +++++ src/main/res/values/strings.xml | 1 + 2 files changed, 6 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java index ee2a15379..863fd5780 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java @@ -257,6 +257,11 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers @Override public boolean onContextItemSelected(MenuItem item) { + final User user = mUserPreviewAdapter.getSelectedUser(); + if (user == null) { + Toast.makeText(this, R.string.unable_to_perform_this_action, Toast.LENGTH_SHORT).show(); + return true; + } if (!MucDetailsContextMenuHelper.onContextItemSelected(item, mUserPreviewAdapter.getSelectedUser(), this)) { return super.onContextItemSelected(item); } diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 8a8d31757..a387e9ec5 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -875,4 +875,5 @@ The file you selected is not a Conversations backup file This account has already been setup Please enter the password for this account + Unable to perform this action