mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Bugfix for there being no registrations for a hook at all
This commit is contained in:
parent
30b018833c
commit
441fd2f8eb
1 changed files with 2 additions and 0 deletions
|
@ -18,12 +18,14 @@ exports.flatten = function (lst) {
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.callAll = function (hook_name, args) {
|
exports.callAll = function (hook_name, args) {
|
||||||
|
if (plugins.hooks[hook_name] === undefined) return [];
|
||||||
return exports.flatten(plugins.hooks[hook_name].map(function (hook) {
|
return exports.flatten(plugins.hooks[hook_name].map(function (hook) {
|
||||||
return hook.hook(hook_name, args, function (x) { return x; });
|
return hook.hook(hook_name, args, function (x) { return x; });
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.aCallAll = function (hook_name, args, cb) {
|
exports.aCallAll = function (hook_name, args, cb) {
|
||||||
|
if (plugins.hooks[hook_name] === undefined) cb([]);
|
||||||
async.map(
|
async.map(
|
||||||
plugins.hooks[hook_name],
|
plugins.hooks[hook_name],
|
||||||
function (hook, cb) {
|
function (hook, cb) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue