prevent admin crashes on improperly configured plugins

v1.18.x
psychobunny 11 years ago
parent bf677522a9
commit d6570d1496

@ -268,7 +268,13 @@ var fs = require('fs'),
fs.readFile(path.join(file, 'plugin.json'), next);
},
function(configJSON, next) {
try {
var config = JSON.parse(configJSON);
} catch (err) {
winston.warn("Plugin: " + file + " is corrupted or invalid. Please check plugin.json for errors.")
return next(err, null);
}
_self.isActive(config.id, function(err, active) {
if (err) next(new Error('no-active-state'));

Loading…
Cancel
Save