mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
#2152 dont pass undefined into parser
This commit is contained in:
@@ -323,13 +323,17 @@ middleware.renderHeader = function(req, res, callback) {
|
||||
var less = require('less');
|
||||
var parser = new (less.Parser)();
|
||||
|
||||
parser.parse(meta.config.customCSS, function(err, tree) {
|
||||
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, '');
|
||||
if (!meta.config.customCSS) {
|
||||
return next(null, '');
|
||||
}
|
||||
|
||||
parser.parse(meta.config.customCSS, function(err, tree) {
|
||||
if (err) {
|
||||
winston.error('[less] Could not convert custom LESS to CSS! Please check your syntax.');
|
||||
return next(null, '');
|
||||
}
|
||||
|
||||
next(null, tree ? tree.toCSS({cleancss: true}) : '');
|
||||
});
|
||||
},
|
||||
customJS: function(next) {
|
||||
|
||||
Reference in New Issue
Block a user