diff options
author | Egil Moeller <egil.moller@freecode.no> | 2012-02-24 20:21:22 +0100 |
---|---|---|
committer | Egil Moeller <egil.moller@freecode.no> | 2012-02-24 20:21:22 +0100 |
commit | 441fd2f8eb4e2fedb4d902c31c3c88fbd096550b (patch) | |
tree | 7a4b1256f26d29c302aab04aa93d47366aad2fd7 | |
parent | 30b018833c3e3ab7092fe5bea96f02d5fec9e292 (diff) | |
download | etherpad-lite-441fd2f8eb4e2fedb4d902c31c3c88fbd096550b.zip |
Bugfix for there being no registrations for a hook at all
-rw-r--r-- | node/pluginfw/hooks.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/node/pluginfw/hooks.js b/node/pluginfw/hooks.js index d284b229..ae256217 100644 --- a/node/pluginfw/hooks.js +++ b/node/pluginfw/hooks.js @@ -18,12 +18,14 @@ exports.flatten = function (lst) { } exports.callAll = function (hook_name, args) { + if (plugins.hooks[hook_name] === undefined) return []; return exports.flatten(plugins.hooks[hook_name].map(function (hook) { return hook.hook(hook_name, args, function (x) { return x; }); })); } exports.aCallAll = function (hook_name, args, cb) { + if (plugins.hooks[hook_name] === undefined) cb([]); async.map( plugins.hooks[hook_name], function (hook, cb) { |