From a8802fc8ac2a8cc4aa98ffebdfd843e9c094ba6c Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Sun, 29 Jan 2012 13:04:43 +0100 Subject: [PATCH] Make parse error handler more robust This is necessary to get useful error messages in cases where root has not been constructed successfully. --- lib/less/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/less/index.js b/lib/less/index.js index 657d9bd0..f0d4e9bf 100644 --- a/lib/less/index.js +++ b/lib/less/index.js @@ -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);