diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-08-09 11:35:49 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-08-09 11:35:49 +0200 |
commit | a059dfab2c53921e99a79a9e7ec9f4503bfac082 (patch) | |
tree | 5c6c2742b7030c94f44578adce692c230b8cad39 | |
parent | 937fc51b503344948997a1924ee6fdba23850315 (diff) |
fixed very rare npe
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/parser/IqParser.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/eu/siacs/conversations/parser/IqParser.java b/src/eu/siacs/conversations/parser/IqParser.java index 49268450..a22ff6a5 100644 --- a/src/eu/siacs/conversations/parser/IqParser.java +++ b/src/eu/siacs/conversations/parser/IqParser.java @@ -27,14 +27,16 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { if (!contact.getOption(Contact.Options.DIRTY_PUSH)) { contact.setServerName(name); } - if (subscription.equals("remove")) { - contact.resetOption(Contact.Options.IN_ROSTER); - contact.resetOption(Contact.Options.DIRTY_DELETE); - contact.resetOption(Contact.Options.PREEMPTIVE_GRANT); - } else { - contact.setOption(Contact.Options.IN_ROSTER); - contact.resetOption(Contact.Options.DIRTY_PUSH); - contact.parseSubscriptionFromElement(item); + if (subscription!=null) { + if (subscription.equals("remove")) { + contact.resetOption(Contact.Options.IN_ROSTER); + contact.resetOption(Contact.Options.DIRTY_DELETE); + contact.resetOption(Contact.Options.PREEMPTIVE_GRANT); + } else { + contact.setOption(Contact.Options.IN_ROSTER); + contact.resetOption(Contact.Options.DIRTY_PUSH); + contact.parseSubscriptionFromElement(item); + } } } } |