From 6bbc32a19f7127b84e2383b151f4c963cc055117 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Wed, 18 Jan 2012 00:28:55 -0800 Subject: [PATCH] Default plugin should not fail if clientVars is not defined. In the case that it is not defined, the configuration is `undefined`. --- static/js/plugins.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/plugins.js b/static/js/plugins.js index b29d01d4..74193462 100644 --- a/static/js/plugins.js +++ b/static/js/plugins.js @@ -7,7 +7,8 @@ plugins = { callHook: function(hookName, args) { - var hook = clientVars.hooks[hookName]; + var global = (function () {return this}()); + var hook = ((global.clientVars || {}).hooks || {})[hookName]; if (hook === undefined) return []; var res = []; for (var i = 0, N = hook.length; i < N; i++)