prevent traceback

This commit is contained in:
Yann Leboulanger 2015-07-28 20:19:19 +02:00
parent 96f642b309
commit 15fce42a60
1 changed files with 3 additions and 1 deletions

View File

@ -914,7 +914,9 @@ class Connection(CommonConnection, ConnectionHandlers):
self.sm.enabled = False
gajim.nec.push_incoming_event(OurShowEvent(None, conn=self,
show='error'))
self.connection.UnregisterDisconnectHandler(self._disconnectedReconnCB)
if self.connection:
self.connection.UnregisterDisconnectHandler(
self._disconnectedReconnCB)
self.disconnect()
if gajim.config.get_per('accounts', self.name, 'autoreconnect'):
self.connected = -1