From e73dbc8f8cc5698efb033c06d986d9b82e955de3 Mon Sep 17 00:00:00 2001 From: Tobias Duehr Date: Mon, 18 Mar 2019 13:50:00 +0100 Subject: [PATCH] No event handler if no dismiss link --- src/Resources/public/script.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Resources/public/script.js b/src/Resources/public/script.js index f52feca..d77cafc 100644 --- a/src/Resources/public/script.js +++ b/src/Resources/public/script.js @@ -13,6 +13,7 @@ ContaoFlash.registerEventHandlers = function(){ if(!elements.length) return; elements.forEach(function(el){ var close = el.querySelector('.flash-dismiss'); + if(!close) return; close.addEventListener('click', function(e){ e.preventDefault(); var xhr = new XMLHttpRequest();