summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2020-04-12 16:43:01 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2020-04-12 16:43:01 +0200
commit8585ef18eb0f32dd1fd1fea122f33b3ae63cc062 (patch)
treeecca5e4022e26ed3d24ebc618f065bae2d049a27
parent14ef4452611be689c04ab0199c9874a6ff131ab5 (diff)
downloadpoezio-8585ef18eb0f32dd1fd1fea122f33b3ae63cc062.tar.gz
poezio-8585ef18eb0f32dd1fd1fea122f33b3ae63cc062.tar.bz2
poezio-8585ef18eb0f32dd1fd1fea122f33b3ae63cc062.tar.xz
poezio-8585ef18eb0f32dd1fd1fea122f33b3ae63cc062.zip
plugins: don't access property on uninitialized plugin
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/plugin_manager.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/poezio/plugin_manager.py b/poezio/plugin_manager.py
index c44a8ecc..874d0dc9 100644
--- a/poezio/plugin_manager.py
+++ b/poezio/plugin_manager.py
@@ -158,13 +158,14 @@ class PluginManager:
if name in self.plugins:
try:
- self.plugins[name]._unloading = True # Prevents loops
- for rdep in self.rdeps[name].copy():
- if rdep in self.plugins and not self.plugins[rdep]._unloading:
- self.unload(rdep)
- if rdep in self.plugins:
- log.debug('Failed to unload reverse dependency %s first.', rdep)
- return None
+ if self.plugins[name] is not None:
+ self.plugins[name]._unloading = True # Prevents loops
+ for rdep in self.rdeps[name].copy():
+ if rdep in self.plugins and not self.plugins[rdep]._unloading:
+ self.unload(rdep)
+ if rdep in self.plugins:
+ log.debug('Failed to unload reverse dependency %s first.', rdep)
+ return None
for command in self.commands[name].keys():
del self.core.commands[command]