plugins: don't access property on uninitialized plugin

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <pep@bouah.net>
parent 14ef4452
......@@ -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]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment