From cdee6523e4ece8c0df503be70dea7ce153836e8b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 8 Dec 2017 14:24:26 +0100 Subject: [PATCH] fix XmppUri for empty uris --- src/main/java/eu/siacs/conversations/utils/XmppUri.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/utils/XmppUri.java b/src/main/java/eu/siacs/conversations/utils/XmppUri.java index bfd4b7c65..0f400aa09 100644 --- a/src/main/java/eu/siacs/conversations/utils/XmppUri.java +++ b/src/main/java/eu/siacs/conversations/utils/XmppUri.java @@ -71,7 +71,12 @@ public class XmppUri { if (uri.getAuthority() != null) { jid = uri.getAuthority(); } else { - jid = uri.getSchemeSpecificPart().split("\\?")[0]; + String[] parts = uri.getSchemeSpecificPart().split("\\?"); + if (parts.length > 1) { + jid = parts[0]; + } else { + return; + } } this.fingerprints = parseFingerprints(uri.getQuery()); this.body = parseBody(uri.getQuery());