mirror of
https://github.com/less/less.js.git
synced 2026-02-05 20:44:58 -05:00
Make parse error handler more robust
This is necessary to get useful error messages in cases where root has not been constructed successfully.
This commit is contained in:
@@ -19,7 +19,7 @@ var less = {
|
||||
|
||||
if (callback) {
|
||||
parser.parse(input, function (e, root) {
|
||||
callback(e, root.toCSS(options));
|
||||
callback(e, root && root.toCSS && root.toCSS(options));
|
||||
});
|
||||
} else {
|
||||
ee = new(require('events').EventEmitter);
|
||||
|
||||
Reference in New Issue
Block a user