fix XmppUri for empty uris

This commit is contained in:
Daniel Gultsch 2017-12-08 14:24:26 +01:00
parent 1b0cd77c57
commit cdee6523e4
1 changed files with 6 additions and 1 deletions

View File

@ -71,7 +71,12 @@ public class XmppUri {
if (uri.getAuthority() != null) { if (uri.getAuthority() != null) {
jid = uri.getAuthority(); jid = uri.getAuthority();
} else { } 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.fingerprints = parseFingerprints(uri.getQuery());
this.body = parseBody(uri.getQuery()); this.body = parseBody(uri.getQuery());