Allow to return null module

This commit is contained in:
Dennis Eichhorn 2019-02-20 22:47:21 +01:00
parent ed34d8d454
commit e60952e75b
2 changed files with 2 additions and 1 deletions

View File

@ -604,7 +604,7 @@ final class ModuleManager
$this->initModule($module); $this->initModule($module);
} }
return $this->running[$module]; return $this->running[$module] ?? new NullModule();
} catch (\Exception $e) { } catch (\Exception $e) {
throw $e; throw $e;
} }

View File

@ -24,4 +24,5 @@ namespace phpOMS\Module;
*/ */
final class NullModule extends ModuleAbstract final class NullModule extends ModuleAbstract
{ {
public function __construct() {}
} }