diff --git a/js/id/id.js b/js/id/id.js index 29338b1a3..5dc8fb127 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -1,6 +1,11 @@ window.iD = function () { var context = {}, - storage = localStorage || {}; + storage; + + // https://github.com/systemed/iD/issues/772 + // http://mathiasbynens.be/notes/localstorage-pattern#comment-9 + try { storage = localStorage } catch (e) {} + storage = storage || {}; context.storage = function(k, v) { if (arguments.length === 1) return storage[k];