prevent traceback when receiving a disco info while we are disconnected. Fixes #5042

This commit is contained in:
Yann Leboulanger 2009-05-21 21:12:11 +02:00
parent 796c5084c5
commit 731c8f691f
1 changed files with 2 additions and 0 deletions

View File

@ -829,6 +829,8 @@ class ConnectionDisco:
def _DiscoverInfoCB(self, con, iq_obj): def _DiscoverInfoCB(self, con, iq_obj):
log.debug('DiscoverInfoCB') log.debug('DiscoverInfoCB')
if not self.connection or self.connected < 2:
return
# According to XEP-0030: # According to XEP-0030:
# For identity: category, type is mandatory, name is optional. # For identity: category, type is mandatory, name is optional.
# For feature: var is mandatory # For feature: var is mandatory