diff options
author | Philipp Hörist <philipp@hoerist.com> | 2020-02-14 18:02:29 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2020-02-14 18:02:29 +0300 |
commit | df4f49c8bc8343038cd2f3ffd7de9382a132166e (patch) | |
tree | 1269467de645fcd0ff7f90f65ad4b1734711d666 | |
parent | 09c2edd3578ae6910c4b9400718ee4a5ee92ecd9 (diff) |
Blocking: Don't fail on malformed stanza
Fixes #99
-rw-r--r-- | nbxmpp/modules/blocking.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nbxmpp/modules/blocking.py b/nbxmpp/modules/blocking.py index fe54c4c..5fac9e6 100644 --- a/nbxmpp/modules/blocking.py +++ b/nbxmpp/modules/blocking.py @@ -47,6 +47,9 @@ class Blocking: return raise_error(log.info, stanza) blocklist = stanza.getTag('blocklist', namespace=NS_BLOCKING) + if blocklist is None: + return raise_error(log.warning, stanza, 'stanza-malformed') + for item in blocklist.getTags('item'): blocked.append(item.getAttr('jid')) |