v1.18.x
barisusakli 9 years ago
parent 2c65b2ecf3
commit b44f3f4811

@ -40,7 +40,7 @@ module.exports = function (Meta) {
if (err) { if (err) {
return next(); return next();
} }
try {
var configObj = JSON.parse(file.toString()); var configObj = JSON.parse(file.toString());
// Minor adjustments for API output // Minor adjustments for API output
@ -50,8 +50,11 @@ module.exports = function (Meta) {
} else { } else {
configObj.screenshot_url = nconf.get('relative_path') + '/images/themes/default.png'; configObj.screenshot_url = nconf.get('relative_path') + '/images/themes/default.png';
} }
next(null, configObj); next(null, configObj);
} catch (err) {
winston.error('[themes] Unable to parse theme.json ' + theme);
next(null, null);
}
}); });
}, function (err, themes) { }, function (err, themes) {
@ -59,9 +62,7 @@ module.exports = function (Meta) {
return callback(err); return callback(err);
} }
themes = themes.filter(function (theme) { themes = themes.filter(Boolean);
return (theme !== undefined);
});
callback(null, themes); callback(null, themes);
}); });
}); });

Loading…
Cancel
Save