Default plugin should not fail if clientVars is not defined.

In the case that it is not defined, the configuration is `undefined`.
This commit is contained in:
Chad Weider 2012-01-18 00:28:55 -08:00
parent 0f7e6feda1
commit 6bbc32a19f
1 changed files with 2 additions and 1 deletions

View File

@ -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++)