From 698733a4ad18ad86aa93478556cf2589d55b25f7 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 29 May 2019 09:01:11 +0100 Subject: [PATCH] Fix crashes when localStorage not available As reported by @bimlas in https://github.com/Jermolene/TiddlyWiki5/issues/3945#issuecomment-496797809 --- plugins/tiddlywiki/browser-storage/rawmarkup.js | 6 ++++++ plugins/tiddlywiki/dynaview/dynaview.js | 15 ++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/tiddlywiki/browser-storage/rawmarkup.js b/plugins/tiddlywiki/browser-storage/rawmarkup.js index bebc76688..629100c84 100644 --- a/plugins/tiddlywiki/browser-storage/rawmarkup.js +++ b/plugins/tiddlywiki/browser-storage/rawmarkup.js @@ -27,6 +27,12 @@ if(Object.prototype.hasOwnProperty.call($tw.hooks.names,hookName)) { function hookBootTiddlersLoaded() { var url = window.location.pathname, log = []; + // Check that browser storage is available + try { + window.localStorage; + } catch(e) { + return; + } // Step through each browsder storage item for(var index=0; index