From f6917c8fa6ed4e2cc4d64e40f622b360dbe47696 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Sat, 1 Sep 2012 17:12:32 +0100 Subject: [PATCH] At least catch no browser storage rather than balking --- lib/less/browser.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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'); + } } }