Cookie consent: Fix crash without localStorage again

This commit is contained in:
Raphael Michel
2021-12-22 10:29:27 +01:00
parent ccb61e0f56
commit 451d3fce05

View File

@@ -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: