From 5365e285146541da292edb045d769ee3f7d35638 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Wed, 9 Jun 2010 21:55:32 -0400 Subject: [PATCH] fix trying to create CSS from null root [browser] --- lib/less/browser.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/less/browser.js b/lib/less/browser.js index ae5e8b3e..8e2141a4 100644 --- a/lib/less/browser.js +++ b/lib/less/browser.js @@ -22,11 +22,10 @@ var readyTimer = setInterval(function () { clearInterval(readyTimer); loadStyleSheets(function (root, sheet, env) { - createCSS(root.toCSS(), sheet, env.lastModified); - if (env.local) { log("less: loading " + sheet.href + " from local storage."); } else { + createCSS(root.toCSS(), sheet, env.lastModified); log("less: parsed " + sheet.href + " successfully."); } }); @@ -40,7 +39,9 @@ if (less.env === 'development') { refreshTimer = setInterval(function () { if (/!refresh/.test(location.hash)) { loadStyleSheets(function (root, sheet, lastModified) { - createCSS(root.toCSS(), sheet, lastModified); + if (root) { + createCSS(root.toCSS(), sheet, lastModified); + } }); } }, 1000);