mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 17:46:16 +01:00
fixed issue where if a hook had no attached methods, it wouldn't work at all... or put simply... nodebb'd break if you had no plugins, heh.
This commit is contained in:
@@ -74,7 +74,7 @@ var fs = require('fs'),
|
||||
var _self = this
|
||||
hookList = this.loadedHooks[hook];
|
||||
|
||||
if(hookList && Array.isArray(hookList)) {
|
||||
if (hookList && Array.isArray(hookList)) {
|
||||
if (global.env === 'development') console.log('Info: [plugins] Firing hook: \'' + hook + '\'');
|
||||
var hookType = hook.split(':')[0];
|
||||
switch(hookType) {
|
||||
@@ -109,6 +109,10 @@ var fs = require('fs'),
|
||||
// Do nothing...
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// Otherwise, this hook contains no methods
|
||||
var returnVal = (Array.isArray(args) ? args[0] : args);
|
||||
if (callback) callback(returnVal);
|
||||
}
|
||||
},
|
||||
showInstalled: function() {
|
||||
|
||||
Reference in New Issue
Block a user