mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
added error handling if bad LESS is written in ACP. closes #1715
This commit is contained in:
@@ -285,7 +285,12 @@ middleware.renderHeader = function(req, res, callback) {
|
|||||||
var parser = new (less.Parser)();
|
var parser = new (less.Parser)();
|
||||||
|
|
||||||
parser.parse(meta.config.customCSS, function(err, tree) {
|
parser.parse(meta.config.customCSS, function(err, tree) {
|
||||||
next(err, tree ? tree.toCSS({cleancss: true}) : '');
|
if (!err) {
|
||||||
|
next(err, tree ? tree.toCSS({cleancss: true}) : '');
|
||||||
|
} else {
|
||||||
|
winston.error('[less] Could not convert custom LESS to CSS! Please check your syntax.');
|
||||||
|
next(undefined, '');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
customJS: function(next) {
|
customJS: function(next) {
|
||||||
|
|||||||
Reference in New Issue
Block a user