Skip to content
Snippets Groups Projects
Commit 517211b6 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

check if we have a connection before we send it sth

parent 0f41e497
No related branches found
No related tags found
No related merge requests found
......@@ -136,6 +136,8 @@ class Connection:
handler(self.name, data)
def _discover(self, ns, jid, node = None): #FIXME: this is in features.py but it is blocking
if not self.connection:
return
iq = common.xmpp.Iq(typ = 'get', to = jid, queryNS = ns)
if node:
iq.setQuerynode(node)
......@@ -966,6 +968,8 @@ class Connection:
traceback.print_exc()
self.connected = 0
self.dispatch('STATUS', 'offline')
if not self.connection:
return
try:
self.connection.disconnect()
except:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment