From 5c0e1100ed8b33db78804d3ddfe7a8e1afefa98d Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Sat, 16 Feb 2019 11:45:06 -0800 Subject: [PATCH] Fix possible NPE in conversation menu. Would occur if someone had previously muted a conversation with themselves. --- .../securesms/conversation/ConversationActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java index 998d08fd26..d38497a626 100644 --- a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java @@ -658,7 +658,11 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity if (isSecureText) menu.findItem(R.id.menu_call_secure).setVisible(false); else menu.findItem(R.id.menu_call_insecure).setVisible(false); - menu.findItem(R.id.menu_mute_notifications).setVisible(false); + MenuItem muteItem = menu.findItem(R.id.menu_mute_notifications); + + if (muteItem != null) { + muteItem.setVisible(false); + } } searchViewItem = menu.findItem(R.id.menu_search);