From 2c004857f622249a8326c97991418accb2475cf9 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 2 Nov 2016 15:21:26 +0100 Subject: [PATCH] handle file attachment when missing connection --- .../java/eu/siacs/conversations/ui/ConversationActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 85be017a2..bf9bcd372 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -64,6 +64,7 @@ import eu.siacs.conversations.services.XmppConnectionService.OnRosterUpdate; import eu.siacs.conversations.ui.adapter.ConversationAdapter; import eu.siacs.conversations.utils.ExceptionHelper; import eu.siacs.conversations.xmpp.OnUpdateBlocklist; +import eu.siacs.conversations.xmpp.XmppConnection; import eu.siacs.conversations.xmpp.jid.InvalidJidException; import eu.siacs.conversations.xmpp.jid.Jid; @@ -1446,7 +1447,8 @@ public class ConversationActivity extends XmppActivity } private long getMaxHttpUploadSize(Conversation conversation) { - return conversation.getAccount().getXmppConnection().getFeatures().getMaxHttpUploadSize(); + final XmppConnection connection = conversation.getAccount().getXmppConnection(); + return connection == null ? -1 : connection.getFeatures().getMaxHttpUploadSize(); } private void setNeverAskForBatteryOptimizationsAgain() {