aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/roster_manager.vala
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 /libdino/src/service/roster_manager.vala
parent3218dc0211ac717230fe03fad82681a626d968b5 (diff)
downloaddino-a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d.tar.gz
dino-a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d.zip
Properly check Jids everywhere
Diffstat (limited to 'libdino/src/service/roster_manager.vala')
-rw-r--r--libdino/src/service/roster_manager.vala14
1 files changed, 9 insertions, 5 deletions
diff --git a/libdino/src/service/roster_manager.vala b/libdino/src/service/roster_manager.vala
index 6f004c01..62428882 100644
--- a/libdino/src/service/roster_manager.vala
+++ b/libdino/src/service/roster_manager.vala
@@ -91,11 +91,15 @@ public class RosterStoreImpl : Roster.Storage, Object {
this.db = db;
foreach (Qlite.Row row in db.roster.select().with(db.roster.account_id, "=", account.id)) {
- Roster.Item item = new Roster.Item();
- item.jid = Jid.parse(row[db.roster.jid]);
- item.name = row[db.roster.handle];
- item.subscription = row[db.roster.subscription];
- items[item.jid] = item;
+ try {
+ Roster.Item item = new Roster.Item();
+ item.jid = new Jid(row[db.roster.jid]);
+ item.name = row[db.roster.handle];
+ item.subscription = row[db.roster.subscription];
+ items[item.jid] = item;
+ } catch (InvalidJidError e) {
+ warning("Ignoring roster entry with invalid Jid: %s", e.message);
+ }
}
}