summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/AccountManager.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/module/plugins/AccountManager.py b/module/plugins/AccountManager.py
index 4ac62e602..b60375699 100644
--- a/module/plugins/AccountManager.py
+++ b/module/plugins/AccountManager.py
@@ -36,12 +36,20 @@ class AccountManager():
def getAccountPlugin(self, plugin):
"""get account instance for plugin or None if anonymous"""
- if plugin in self.accounts:
- if plugin not in self.plugins:
- self.plugins[plugin] = self.core.pluginManager.loadClass("accounts", plugin)(self, self.accounts[plugin])
-
- return self.plugins[plugin]
- else:
+ try:
+ if plugin in self.accounts:
+ if plugin not in self.plugins:
+ klass = self.core.pluginManager.loadClass("accounts", plugin)
+ if klass:
+ self.plugins[plugin] = klass(self, self.accounts[plugin])
+ else:
+ self.logCritical(_("Account plugin %s not loaded") % plugin)
+ raise
+
+ return self.plugins[plugin]
+ else:
+ raise
+ except:
return None