diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-12-01 10:25:36 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-12-01 10:25:36 +0100 |
commit | 5992d4ac0006a473b1dd624a93015683c41e2c10 (patch) | |
tree | f932693a8ead392b0d041d8b3060aed4db6b844e /src/main/java/eu/siacs | |
parent | 21f77cd1e32753a6ea7d98900d9d64c5cdd8ce2b (diff) |
fixed npe if roster jid couldnt be parsed
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r-- | src/main/java/eu/siacs/conversations/parser/IqParser.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/IqParser.java b/src/main/java/eu/siacs/conversations/parser/IqParser.java index b38cdc72..aeec56d0 100644 --- a/src/main/java/eu/siacs/conversations/parser/IqParser.java +++ b/src/main/java/eu/siacs/conversations/parser/IqParser.java @@ -25,14 +25,11 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { } for (Element item : query.getChildren()) { if (item.getName().equals("item")) { - Jid jid; - try { - jid = Jid.fromString(item.getAttribute("jid")); - } catch (final InvalidJidException e) { - // TODO: Handle this? - jid = null; - } - String name = item.getAttribute("name"); + final Jid jid = item.getAttributeAsJid("jid"); + if (jid == null) { + break; + } + String name = item.getAttribute("name"); String subscription = item.getAttribute("subscription"); Contact contact = account.getRoster().getContact(jid); if (!contact.getOption(Contact.Options.DIRTY_PUSH)) { |