diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-08-31 15:21:36 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-08-31 15:21:36 +0200 |
commit | ca21a38cb691aff03fb6a376cbd22e91f3c02ce1 (patch) | |
tree | 487326f3353b23d575117bb4ed77636518cbc8f4 | |
parent | 4142360189a66efee8561fcbbef0963bce104348 (diff) |
catch npe on participants context menu
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java | 5 | ||||
-rw-r--r-- | src/main/res/values/strings.xml | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index cdd4a00df..8b1980c6c 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -304,6 +304,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 1a8cb52a8..8f8070f3c 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -931,4 +931,5 @@ <string name="not_a_backup_file">The file you selected is not a Conversations backup file</string> <string name="account_already_setup">This account has already been setup</string> <string name="please_enter_password">Please enter the password for this account</string> + <string name="unable_to_perform_this_action">Unable to perform this action</string> </resources> |