diff --git a/lib/less/parser.js b/lib/less/parser.js index bb060fd6..27a0e5b9 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -99,7 +99,7 @@ less.Parser = function Parser(env) { callback(e, root, imported); - if (that.queue.length === 0) { finish() } // Call `finish` if we're done importing + if (that.queue.length === 0) { finish(e) } // Call `finish` if we're done importing }, env); } }; @@ -431,7 +431,10 @@ less.Parser = function Parser(env) { } if (this.imports.queue.length > 0) { - finish = function () { callback(error, root) }; + finish = function (e) { + if (e) callback(e); + else callback(null, root); + }; } else { callback(error, root); }