prevent traceback when server doen't include a query in jabber:iq:roster reply. Fixes #4579

This commit is contained in:
Yann Leboulanger 2008-12-15 15:32:59 +00:00
parent 5c8cd8839a
commit 24bb239fdb
1 changed files with 15 additions and 13 deletions

View File

@ -68,7 +68,9 @@ class Roster(PlugIn):
if not sender is None and not sender.bareMatch( if not sender is None and not sender.bareMatch(
self._owner.User + '@' + self._owner.Server): self._owner.User + '@' + self._owner.Server):
return return
for item in stanza.getTag('query').getTags('item'): query = stanza.getTag('query')
if query:
for item in query.getTags('item'):
jid=item.getAttr('jid') jid=item.getAttr('jid')
if item.getAttr('subscription')=='remove': if item.getAttr('subscription')=='remove':
if jid in self._data: del self._data[jid] if jid in self._data: del self._data[jid]