fix trying to create CSS from null root [browser]

This commit is contained in:
cloudhead
2010-06-09 21:55:32 -04:00
parent 5037a0eb45
commit 5365e28514

View File

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