changeset 289939ae9c7c in /home/hg/repos/gajim-plugins
author: lovetox forenjunkie@chello.at branches: details:gajim-plugins?cmd=changeset;node=289939ae9c7c description: Catch an error when opening config dialog
If the config dialog was opend before any chat window ui_list[] was empty and a key error was thrown
diffstat:
omemo/ui.py | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
diffs (28 lines):
diff -r ea16d26010e7 -r 289939ae9c7c omemo/ui.py --- a/omemo/ui.py Sun Jun 05 13:36:30 2016 +0200 +++ b/omemo/ui.py Sun Jun 05 18:09:10 2016 +0200 @@ -206,15 +206,19 @@ response = dlg.run() if response == gtk.RESPONSE_YES: state.store.identityKeyStore.setTrust(_id, TRUSTED) - if self.plugin.ui_list[account][user]: + try: + if self.plugin.ui_list[account]: self.plugin.ui_list[account][user].refreshAuthLockSymbol() - dlg.destroy() + except: + dlg.destroy() else: if response == gtk.RESPONSE_NO: state.store.identityKeyStore.setTrust(_id, UNTRUSTED) - if self.plugin.ui_list[account][user]: - self.plugin.ui_list[account][user].refreshAuthLockSymbol() - dlg.destroy() + try: + if user in self.plugin.ui_list[account]: + self.plugin.ui_list[account][user].refreshAuthLockSymbol() + except: + dlg.destroy()
self.update_context_list()