From 9536ebb214a581c730cb93b137b180b87226c8fb Mon Sep 17 00:00:00 2001
From: Denis Fomin <fominde@gmail.com>
Date: Sun, 22 Apr 2012 17:15:50 +0400
Subject: [PATCH] Juick. prevent traceback

---
 juick/plugin.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/juick/plugin.py b/juick/plugin.py
index cb28583d..5f2ed884 100644
--- a/juick/plugin.py
+++ b/juick/plugin.py
@@ -56,6 +56,7 @@ class JuickPlugin(GajimPlugin):
                     'MENUITEM10': ('', ''), 'MENUITEM_TEXT10': ('', ''), }
         self.chat_control = None
         self.controls = []
+        self.conn = None
         self.cache_path = os.path.join(gajim.AVATAR_PATH, 'juick')
         if not os.path.isdir(self.cache_path):
             os.makedirs(self.cache_path)
@@ -78,7 +79,8 @@ class JuickPlugin(GajimPlugin):
         for control in self.controls:
             control.disconnect_from_chat_control()
         self.controls = []
-        self.conn.close()
+        if self.conn:
+            self.conn.close()
 
     def print_special_text(self, tv, special_text, other_tags, graphics=True):
         for control in self.controls:
-- 
GitLab