aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-07-04 19:29:46 +0200
committerChristian Schneppe <christian@pix-art.de>2016-07-09 09:47:54 +0200
commit54c00816400af8aa47fe5d3ca641d46b118dd356 (patch)
treedf311ce811fab553a70cb295bf6b03ddfbc05a1b /src/main/java/eu
parenta11c52e679e06db94d887a29c39a67b625cdc52e (diff)
do not crash on jingle connection when contact doesn't use disco
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
index 1001cfe45..86c445279 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
@@ -24,6 +24,7 @@ import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.DownloadableFile;
import eu.siacs.conversations.entities.Message;
import eu.siacs.conversations.entities.Presence;
+import eu.siacs.conversations.entities.ServiceDiscoveryResult;
import eu.siacs.conversations.entities.Transferable;
import eu.siacs.conversations.entities.TransferablePlaceholder;
import eu.siacs.conversations.persistance.FileBackend;
@@ -300,8 +301,9 @@ public class JingleConnection implements Transferable {
String resource = jid != null ?jid.getResourcepart() : null;
if (resource != null) {
Presence presence = this.account.getRoster().getContact(jid).getPresences().getPresences().get(resource);
- if (presence != null) {
- List<String> features = presence.getServiceDiscoveryResult().getFeatures();
+ ServiceDiscoveryResult result = presence != null ? presence.getServiceDiscoveryResult() : null;
+ if (result != null) {
+ List<String> features = result.getFeatures();
if (features.contains(Content.Version.FT_4.getNamespace())) {
this.ftVersion = Content.Version.FT_4;
}