mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-10 17:41:34 +02:00
Fixed crash on launch if no hooks listen to filter:router.page
A previous commit added a new hook, although it executed async.each on a var without a null check, so if no hooks were registered, it was null, and not an empty array, causing async to crash.
This commit is contained in:
@@ -67,7 +67,7 @@ middleware.pageView = function(req, res, next) {
|
||||
};
|
||||
|
||||
middleware.pluginHooks = function(req, res, next) {
|
||||
async.each(plugins.loadedHooks['filter:router.page'], function(hookObj, next) {
|
||||
async.each(plugins.loadedHooks['filter:router.page'] || [], function(hookObj, next) {
|
||||
hookObj.method(req, res, next)
|
||||
}, function(req, res) {
|
||||
// If it got here, then none of the subscribed hooks did anything, or there were no hooks
|
||||
|
||||
Reference in New Issue
Block a user