diff options
author | Lance Stout <lancestout@gmail.com> | 2010-07-19 04:12:54 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-07-19 04:12:54 -0400 |
commit | 797e92a6a3cf1534f6ecb0f30019b0135d0ffacb (patch) | |
tree | 9bc458c709203db6697ff8d47be2ea5add1201b9 /sleekxmpp/stanza | |
parent | 1ef112966bd591e5cd075cb2287724c7ae4bc05e (diff) | |
download | slixmpp-797e92a6a3cf1534f6ecb0f30019b0135d0ffacb.tar.gz slixmpp-797e92a6a3cf1534f6ecb0f30019b0135d0ffacb.tar.bz2 slixmpp-797e92a6a3cf1534f6ecb0f30019b0135d0ffacb.tar.xz slixmpp-797e92a6a3cf1534f6ecb0f30019b0135d0ffacb.zip |
Fixed error in updateRoster when the name keyword parameter is left out.
The Roster stanza object builds item elements manually, and did not handle the
case where the name attribute is set to None, which would crash SleekXMPP.
Diffstat (limited to 'sleekxmpp/stanza')
-rw-r--r-- | sleekxmpp/stanza/roster.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sleekxmpp/stanza/roster.py b/sleekxmpp/stanza/roster.py index 1fefc180..69027b6c 100644 --- a/sleekxmpp/stanza/roster.py +++ b/sleekxmpp/stanza/roster.py @@ -23,7 +23,9 @@ class Roster(ElementBase): if 'subscription' in items[jid]: item.attrib['subscription'] = items[jid]['subscription'] if 'name' in items[jid]: - item.attrib['name'] = items[jid]['name'] + name = items[jid]['name'] + if name is not None: + item.attrib['name'] = name if 'groups' in items[jid]: for group in items[jid]['groups']: groupxml = ET.Element('{jabber:iq:roster}group') |