From 848c339c8db177aad7db07bdf0a0ff8d0ecdea24 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 25 Apr 2017 14:11:45 +0200 Subject: [PATCH] make sure context is not null before setting content description on send button --- .../eu/siacs/conversations/ui/ConversationFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 1cd5507b5..e054f41e6 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -903,9 +903,11 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa updateChatState(this.conversation, msg); } this.conversation.trim(); - this.mSendButton.setContentDescription(this.getActivity().getApplicationContext().getString(R.string.send_message_to_x,conversation.getName())); - } else { - this.mSendButton.setContentDescription(this.getActivity().getApplicationContext().getString(R.string.send_message)); + + } + + if (activity != null) { + this.mSendButton.setContentDescription(activity.getString(R.string.send_message_to_x,conversation.getName())); } this.conversation = conversation;