dont crash if config is undefined, added error to plugins

v1.18.x
barisusakli 10 years ago
parent 772f4c103a
commit 9f7196f5b0

@ -463,8 +463,8 @@ middleware.processRender = function(req, res, next) {
if (res.locals.renderHeader) {
middleware.renderHeader(req, res, function(err, template) {
str = template + str;
translator.translate(str, res.locals.config.userLang, function(translated) {
var language = res.locals.config ? res.locals.config.userLang || 'en_GB' : 'en_GB';
translator.translate(str, language, function(translated) {
fn(err, translated);
});
});
@ -568,7 +568,7 @@ middleware.publicTagListing = function(req, res, next) {
middleware.ensureLoggedIn(req, res, next);
}
}
}
};
module.exports = function(webserver) {
app = webserver;

@ -615,6 +615,7 @@ var fs = require('fs'),
pluginMap[plugin.id].description = plugin.description;
pluginMap[plugin.id].url = pluginMap[plugin.id].url || plugin.url;
pluginMap[plugin.id].installed = true;
pluginMap[plugin.id].error = plugin.error;
pluginMap[plugin.id].active = plugin.active;
pluginMap[plugin.id].error = pluginMap[plugin.id].error || false;
pluginMap[plugin.id].version = plugin.version;

Loading…
Cancel
Save