aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-06-08 14:12:09 +0200
committerChristian Schneppe <christian@pix-art.de>2019-06-08 14:12:09 +0200
commit82a30751351329f670fc85e58d125fe1c33e4889 (patch)
treefaa81349411ea66051bd09d707ebf0390e05f50a /src/main/java
parent1fbb92fb4f69fb8ee3eb2759d96c1a9899b32a99 (diff)
double check that activity is not null in updateSend button
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index c47850461..f0ea6113b 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -2532,7 +2532,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
public void updateSendButton() {
updateChatMsgHint();
boolean hasAttachments = mediaPreviewAdapter != null && mediaPreviewAdapter.hasAttachments();
- boolean useSendButtonToIndicateStatus = PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("send_button_status", getResources().getBoolean(R.bool.send_button_status));
+ boolean useSendButtonToIndicateStatus = activity != null && PreferenceManager.getDefaultSharedPreferences(activity).getBoolean("send_button_status", getResources().getBoolean(R.bool.send_button_status));
final Conversation c = this.conversation;
final Presence.Status status;
final String text = this.binding.textinput == null ? "" : this.binding.textinput.getText().toString();
@@ -2543,7 +2543,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
action = SendButtonTool.getAction(getActivity(), c, text);
}
if (useSendButtonToIndicateStatus && c.getAccount().getStatus() == Account.State.ONLINE) {
- if (activity.xmppConnectionService != null && activity.xmppConnectionService.getMessageArchiveService().isCatchingUp(c)) {
+ if (activity != null && activity.xmppConnectionService != null && activity.xmppConnectionService.getMessageArchiveService().isCatchingUp(c)) {
status = Presence.Status.OFFLINE;
} else if (c.getMode() == Conversation.MODE_SINGLE) {
status = c.getContact().getShownStatus();