prevent crash if registerHook is called with invalid hook name
This commit is contained in:
barisusakli
2016-07-27 22:17:02 +03:00
parent a9a522c8ec
commit af75a887b5

View File

@@ -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) {