From a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 22 Dec 2019 04:10:53 +0100 Subject: Properly check Jids everywhere --- xmpp-vala/src/core/xmpp_stream.vala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'xmpp-vala/src/core') diff --git a/xmpp-vala/src/core/xmpp_stream.vala b/xmpp-vala/src/core/xmpp_stream.vala index 97d00004..39754ba1 100644 --- a/xmpp-vala/src/core/xmpp_stream.vala +++ b/xmpp-vala/src/core/xmpp_stream.vala @@ -44,7 +44,11 @@ public class XmppStream { } public async void connect(string? remote_name = null) throws IOStreamError { - if (remote_name != null) this.remote_name = Jid.parse(remote_name); + try { + if (remote_name != null) this.remote_name = new Jid(remote_name); + } catch (InvalidJidError e) { + throw new IOStreamError.CONNECT(@"Invalid remote name \"$remote_name\": $(e.message)"); + } attach_negotation_modules(); try { int min_priority = -1; -- cgit v1.2.3-54-g00ecf