Skip to content

Commit

Permalink
fix: ControllerFactory throws an error when a controller key isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
sahachide committed Sep 21, 2020
1 parent d4e7971 commit a9c28dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/controller/ControllerFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(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<T>(module, [this.templateEnvironment])
const instance = this.injector.inject<T>(controller.module, [this.templateEnvironment])

return instance
}
Expand Down

0 comments on commit a9c28dc

Please sign in to comment.