From 6040a4dc67f7d523d86f6e3afcf17e5e30ad2152 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Tue, 14 Jul 2015 19:11:11 -0400 Subject: [PATCH] prevent null ref --- mithril.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index 32d925c3..3b8f2bfc 100644 --- a/mithril.js +++ b/mithril.js @@ -557,7 +557,7 @@ var m = (function app(window, undefined) { var controller = function() { return (component.controller || noop).apply(this, args) || this; }; - controller.prototype = component.controller.prototype + if (component.controller) controller.prototype = component.controller.prototype var view = function(ctrl) { if (arguments.length > 1) args = args.concat([].slice.call(arguments, 1)); return component.view.apply(component, args ? [ctrl].concat(args) : [ctrl]);