diff options
author | Marvin W <git@larma.de> | 2019-12-22 04:10:53 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2019-12-23 16:58:53 +0100 |
commit | a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d (patch) | |
tree | cbb079649066c2001b6d6881137108e70eed9d3f /xmpp-vala/src/module/xep/0030_service_discovery | |
parent | 3218dc0211ac717230fe03fad82681a626d968b5 (diff) | |
download | dino-a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d.tar.gz dino-a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d.zip |
Properly check Jids everywhere
Diffstat (limited to 'xmpp-vala/src/module/xep/0030_service_discovery')
-rw-r--r-- | xmpp-vala/src/module/xep/0030_service_discovery/items_result.vala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/xmpp-vala/src/module/xep/0030_service_discovery/items_result.vala b/xmpp-vala/src/module/xep/0030_service_discovery/items_result.vala index 16a9f5ec..233a0c06 100644 --- a/xmpp-vala/src/module/xep/0030_service_discovery/items_result.vala +++ b/xmpp-vala/src/module/xep/0030_service_discovery/items_result.vala @@ -9,9 +9,13 @@ public class ItemsResult { owned get { ArrayList<Item> ret = new ArrayList<Item>(); foreach (StanzaNode feature_node in iq.stanza.get_subnode("query", NS_URI_ITEMS).get_subnodes("item", NS_URI_ITEMS)) { - ret.add(new Item(Jid.parse(feature_node.get_attribute("jid", NS_URI_ITEMS)), - feature_node.get_attribute("name", NS_URI_ITEMS), - feature_node.get_attribute("node", NS_URI_ITEMS))); + try { + ret.add(new Item(new Jid(feature_node.get_attribute("jid", NS_URI_ITEMS)), + feature_node.get_attribute("name", NS_URI_ITEMS), + feature_node.get_attribute("node", NS_URI_ITEMS))); + } catch (InvalidJidError e) { + warning("Ignoring service at invalid Jid: %s", e.message); + } } return ret; } |