From 762ae5fd4d1a551afae70600f7df06cc522cbe96 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 28 Nov 2021 23:31:36 +0100 Subject: [PATCH] Improved module loading --- src/modules_core/service/module_service.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules_core/service/module_service.py b/src/modules_core/service/module_service.py index db61fbc..2d16bf6 100644 --- a/src/modules_core/service/module_service.py +++ b/src/modules_core/service/module_service.py @@ -75,7 +75,11 @@ class ModuleService(ModuleServiceABC, commands.Cog, metaclass=_MetaCogABC): module_types = self._modules.where(lambda m: issubclass(m, t)) modules = List(t) for module_type in module_types: - modules.append(self._services.get_service(module_type)) + module = self._services.get_service(module_type) + if module is None: + self._logger.warn(__name__, f'Module {module_type} not found in services!') + break + modules.append(module) return modules.order_by(lambda m: m.get_priority(t))