Work around a reported NoneType exception.
This commit is contained in:
parent
d5ac527f84
commit
004619f99e
|
@ -2468,8 +2468,12 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
||||||
for sess in self.sessions[jid].values():
|
for sess in self.sessions[jid].values():
|
||||||
if not sess.received_thread_id:
|
if not sess.received_thread_id:
|
||||||
contact = gajim.contacts.get_contact(self.name, jid)
|
contact = gajim.contacts.get_contact(self.name, jid)
|
||||||
|
# FIXME: I don't know if this is the correct behavior here.
|
||||||
session_supported = contact.supports(common.xmpp.NS_SSN) or \
|
# Anyway, it is the old behavior when we assumed that
|
||||||
|
# not-existing contacts don't support anything
|
||||||
|
contact_exists = bool(contact)
|
||||||
|
session_supported = contact_exists and \
|
||||||
|
contact.supports(common.xmpp.NS_SSN) or \
|
||||||
contact.supports(common.xmpp.NS_ESESSION)
|
contact.supports(common.xmpp.NS_ESESSION)
|
||||||
if session_supported:
|
if session_supported:
|
||||||
sess.terminate()
|
sess.terminate()
|
||||||
|
|
Loading…
Reference in New Issue