aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0030_service_discovery
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2019-12-22 04:10:53 +0100
committerMarvin W <git@larma.de>2019-12-23 16:58:53 +0100
commita0a956ee0878d24bd06be7f5d75dc4ccd4e7901d (patch)
treecbb079649066c2001b6d6881137108e70eed9d3f /xmpp-vala/src/module/xep/0030_service_discovery
parent3218dc0211ac717230fe03fad82681a626d968b5 (diff)
downloaddino-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.vala10
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;
}