From 944950d7c8c10c8693964ab30e9ed120fd0fe8f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20H=C3=B6rist?= <forenjunkie@chello.at>
Date: Tue, 10 Jan 2017 16:39:07 +0100
Subject: [PATCH] [httpupload] Fix reference error

omemo was not assigned before reference
if there was no omemo plugin found
---
 httpupload/httpupload.py | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/httpupload/httpupload.py b/httpupload/httpupload.py
index e845e3dc..a917f4c5 100644
--- a/httpupload/httpupload.py
+++ b/httpupload/httpupload.py
@@ -282,13 +282,10 @@ class Base(object):
         account = self.chat_control.account
         for plugin in gajim.plugin_manager.active_plugins:
             if type(plugin).__name__ == 'OmemoPlugin':
-                omemo = plugin
-                break
-        if omemo:
-            state = omemo.get_omemo_state(account)
-            log.info('Encryption is: ' +
-                      str(state.encryption.is_active(jid)))
-            return state.encryption.is_active(jid)
+                state = plugin.get_omemo_state(account)
+                log.info('Encryption is: ' +
+                          str(state.encryption.is_active(jid)))
+                return state.encryption.is_active(jid)
         log.info('Encryption is: False / OMEMO not found')
         return False
 
-- 
GitLab