From ac8aa639164956cb2a9307df958a53d3423c4616 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 4 Jul 2016 19:29:46 +0200 Subject: do not crash on jingle connection when contact doesn't use disco --- .../java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java | 6 ++++-- 1 file 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 95c998d0..89ab30cd 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java @@ -22,6 +22,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; @@ -297,8 +298,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 features = presence.getServiceDiscoveryResult().getFeatures(); + ServiceDiscoveryResult result = presence != null ? presence.getServiceDiscoveryResult() : null; + if (result != null) { + List features = result.getFeatures(); if (features.contains(Content.Version.FT_4.getNamespace())) { this.ftVersion = Content.Version.FT_4; } -- cgit v1.2.3