Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
malomalo committed Aug 12, 2020
1 parent caab9ea commit 0d445d8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/viking/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ export default class Router extends EventBus {
if (typeof handler.callback === 'object') {
if (handler.callback.controller) {
if (Controller.isPrototypeOf(handler.callback.controller)) {
this.application.controller = new handler.callback.controller(this.application)
this.application.controller.dispatch(handler.callback.action, ...args);
var controller = new handler.callback.controller(this.application)
if (this.application) {
this.application.controller = controller;
}
controller.dispatch(handler.callback.action, ...args);
} else {
handler.callback.controller[handler.callback.action](...args);
}
Expand Down

0 comments on commit 0d445d8

Please sign in to comment.