Skip to content

Node.js based forum software built for the modern web

check undefined middleware

barisusaklie79e370e5968
diff --git a/src/plugins.js b/src/plugins.js
index 90eacfbb83..59e177ad53 100644
--- a/src/plugins.js
+++ b/src/plugins.js
@@ -128,6 +128,11 @@ var fs = require('fs'),
app.render.apply(app, arguments);
};
+ if (!middleware) {
+ var e = new Error('middleware undefined');
+ console.log(e.stack);
+ }
+
// Deprecated as of v0.5.0, remove this hook call for NodeBB v0.6.0-1
Plugins.fireHook('action:app.load', router, middleware, controllers);
@@ -150,7 +155,7 @@ var fs = require('fs'),
} catch (err) {
var pluginDir = pluginPath.split(path.sep);
pluginDir = pluginDir[pluginDir.length -1];
-
+
winston.error('[plugins/' + pluginDir + '] Plugin not loaded - please check its plugin.json for errors');
return callback();
}