mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 17:46:16 +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;
|
||||
|
||||
if (Object.keys(Plugins.deprecatedHooks).indexOf(data.hook) !== -1) {
|
||||
|
||||
Reference in New Issue
Block a user