From a9c28dca28f90198b17f25967a0d414f6c734962 Mon Sep 17 00:00:00 2001 From: sahachide Date: Mon, 21 Sep 2020 17:04:32 +0200 Subject: [PATCH] fix: ControllerFactory throws an error when a controller key isn't found --- src/controller/ControllerFactory.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controller/ControllerFactory.ts b/src/controller/ControllerFactory.ts index f0e39d6..3c8ff5c 100644 --- a/src/controller/ControllerFactory.ts +++ b/src/controller/ControllerFactory.ts @@ -37,13 +37,13 @@ export class ControllerFactory extends AbstractFactory { * @param key The key of the controller. That's either its filename or the exported member. */ public build(key: string): T { - const { module } = this.controllers.get(key) + const controller = this.controllers.get(key) - if (!module) { + if (!controller) { return null } - const instance = this.injector.inject(module, [this.templateEnvironment]) + const instance = this.injector.inject(controller.module, [this.templateEnvironment]) return instance }