diff --git a/lib/less/browser.js b/lib/less/browser.js index d7f53646..b7de8be8 100644 --- a/lib/less/browser.js +++ b/lib/less/browser.js @@ -217,8 +217,13 @@ function createCSS(styles, sheet, lastModified) { // Don't update the local store if the file wasn't modified if (lastModified && cache) { log('saving ' + href + ' to cache.'); - cache.setItem(href, styles); - cache.setItem(href + ':timestamp', lastModified); + try { + cache.setItem(href, styles); + cache.setItem(href + ':timestamp', lastModified); + } catch(e) { + //TODO - could do with adding more robust error handling + log('failed to save'); + } } }