changeset 5343cfa6cf9c in /home/hg/repos/gajim-plugins
author: lovetox forenjunkie@chello.at branches: details:gajim-plugins?cmd=changeset;node=5343cfa6cf9c description: Catch an error when the UI is not present
If the UI (Chat Window) is not open a key error is thrown
diffstat:
omemo/__init__.py | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
diffs (19 lines):
diff -r 3285a344f63b -r 5343cfa6cf9c omemo/__init__.py --- a/omemo/__init__.py Wed Jun 08 21:04:49 2016 +0200 +++ b/omemo/__init__.py Thu Jun 09 17:23:44 2016 +0200 @@ -430,8 +430,13 @@ if state.build_session(recipient_id, device_id, bundle_dict): log.warn(recipient_id + ' => session created') # Warn User about new Fingerprints in DB if Chat Window is Open - if self.ui_list[account_name][recipient_id]: - self.ui_list[account_name][recipient_id].WarnIfUndecidedFingerprints() + try: + if self.ui_list[account_name][recipient_id]: + self.ui_list[account_name][recipient_id]. \ + WarnIfUndecidedFingerprints() + except: + log.debug('No Ui present for ' + recipient_id + + ', Ui Warning not shown')
@log_calls('OmemoPlugin') def announce_support(self, account):