Skip to content

Commit

Permalink
[BUGFIX] Fix JavaScript error when cookieconsent.min.js is blocked by…
Browse files Browse the repository at this point in the history
… secure browser (#1453)

Added missing check whether the method initialise() exists

Co-authored-by: Benjamin Kott <[email protected]>
  • Loading branch information
stephankellermayr and benjaminkott authored Oct 10, 2024
1 parent 3988f66 commit 2ed9ddd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Resources/Public/JavaScript/Src/bootstrap.cookieconsent.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ window.addEventListener('DOMContentLoaded', function () {
};

// Initialize
cookieConsentOptions.container = document.getElementById('cookieconsent');
window.cookieconsent.initialise(cookieConsentOptions);
if (typeof window.cookieconsent.initialise === "function") {
cookieConsentOptions.container = document.getElementById('cookieconsent');
window.cookieconsent.initialise(cookieConsentOptions);
}
}

});

0 comments on commit 2ed9ddd

Please sign in to comment.