mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
closes #4892
prevent crash if registerHook is called with invalid hook name
This commit is contained in:
@@ -23,6 +23,10 @@ module.exports = function(Plugins) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!data.hook) {
|
||||||
|
return winston.warn('[plugins/' + id + '] registerHook called with invalid data.hook', data);
|
||||||
|
}
|
||||||
|
|
||||||
var method;
|
var method;
|
||||||
|
|
||||||
if (Object.keys(Plugins.deprecatedHooks).indexOf(data.hook) !== -1) {
|
if (Object.keys(Plugins.deprecatedHooks).indexOf(data.hook) !== -1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user