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);