From 451d3fce0575d85a0ea93fd64aa0631feaced967 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 22 Dec 2021 10:29:27 +0100 Subject: [PATCH] Cookie consent: Fix crash without localStorage again --- src/pretix/static/pretixpresale/js/ui/cookieconsent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pretix/static/pretixpresale/js/ui/cookieconsent.js b/src/pretix/static/pretixpresale/js/ui/cookieconsent.js index 2e07c30740..873d4b8bc4 100644 --- a/src/pretix/static/pretixpresale/js/ui/cookieconsent.js +++ b/src/pretix/static/pretixpresale/js/ui/cookieconsent.js @@ -5,7 +5,7 @@ $(function () { var storage_key = $("#cookie-consent-storage-key").text(); function update_consent(consent) { - if (storage_key) window.localStorage[storage_key] = JSON.stringify(consent); + if (storage_key && window.localStorage) window.localStorage[storage_key] = JSON.stringify(consent); window.pretix.cookie_consent = consent; // Event() is not supported by IE11, see ployfill here: