diff --git a/src/static/js/pluginfw/hooks.js b/src/static/js/pluginfw/hooks.js index 75e37315f..14bd9d57e 100644 --- a/src/static/js/pluginfw/hooks.js +++ b/src/static/js/pluginfw/hooks.js @@ -352,7 +352,7 @@ exports.aCallAll = async (hookName, context, cb = null) => { }; exports.callFirst = (hookName, context) => { - if (!context) context = {}; + if (context == null) context = {}; const predicate = (val) => val.length; const hooks = pluginDefs.hooks[hookName] || []; for (const hook of hooks) { @@ -366,7 +366,7 @@ exports.aCallFirst = async (hookName, context, cb = null, predicate = null) => { if (cb != null) { return await attachCallback(exports.aCallFirst(hookName, context, null, predicate), cb); } - if (!context) context = {}; + if (context == null) context = {}; if (predicate == null) predicate = (val) => val.length; const hooks = pluginDefs.hooks[hookName] || []; for (const hook of hooks) {