From c1948d05e06198ce2613226276adf60b6f3d368a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20H=C3=B6rist?= <philipp@hoerist.com>
Date: Sat, 16 Mar 2019 15:38:19 +0100
Subject: [PATCH] Get module instance after checking for zeroconf

---
 gajim/plugins/pluginmanager.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gajim/plugins/pluginmanager.py b/gajim/plugins/pluginmanager.py
index e48d0e7518..f23ea7ee9d 100644
--- a/gajim/plugins/pluginmanager.py
+++ b/gajim/plugins/pluginmanager.py
@@ -406,9 +406,9 @@ class PluginManager(metaclass=Singleton):
             return
         for con in app.connections.values():
             for module in plugin.modules:
-                instance, name = module.get_instance(con)
                 if not module.zeroconf and con.name == 'Local':
                     continue
+                instance, name = module.get_instance(con)
                 modules.register_single(con, instance, name)
 
                 # If handlers have been registered, register the
@@ -558,9 +558,9 @@ class PluginManager(metaclass=Singleton):
                 return
 
             for module in plugin.modules:
-                instance, name = module.get_instance(con)
                 if not module.zeroconf and con.name == 'Local':
                     continue
+                instance, name = module.get_instance(con)
                 modules.register_single(con, instance, name)
 
     def _plugin_is_active_in_global_config(self, plugin):
-- 
GitLab