# HG changeset patch # User souliane # Date 1448357962 -3600 # Node ID 62cd8fc1aef769a43fa360b0a738c4a6b799cfe9 # Parent 069abd15354f4f1ff0b1c169b806b02c60c225c4 plugin sec_otr: fixes bad handling of entity disconnection diff -r 069abd15354f -r 62cd8fc1aef7 src/plugins/plugin_sec_otr.py --- a/src/plugins/plugin_sec_otr.py Mon Nov 23 23:30:41 2015 +0100 +++ b/src/plugins/plugin_sec_otr.py Tue Nov 24 10:39:22 2015 +0100 @@ -476,7 +476,11 @@ if show != C.PRESENCE_UNAVAILABLE: return True if not entity.resource: - entity.resource = self.host.memory.getMainResource(entity, profile) # FIXME: temporary and unsecure, must be changed when frontends are refactored - otrctx = self.context_managers[profile].getContextForUser(entity) - otrctx.disconnect() + try: + entity.resource = self.host.memory.getMainResource(entity, profile) # FIXME: temporary and unsecure, must be changed when frontends are refactored + except exceptions.UnknownEntityError: + return True # entity was not connected + if entity in self.context_managers[profile].contexts: + otrctx = self.context_managers[profile].getContextForUser(entity) + otrctx.disconnect() return True