]> git.p6c8.net - jirafeau_mojo42.git/commitdiff
[BUGFIX] Prevent addCopyListener to add event on undefined button when preview option...
authorsebastien <sebastien@nobelconnexion.fr>
Tue, 15 Oct 2019 13:07:36 +0000 (15:07 +0200)
committerJerome Jutteau <jerome@jutteau.fr>
Mon, 21 Oct 2019 19:36:13 +0000 (21:36 +0200)
lib/functions.js.php

index 845da827ac7adb91c5199e3b47977918ba903922..532787d4ae4bb609864642ae4e5afd2d6981b017 100644 (file)
@@ -742,8 +742,10 @@ function copyLinkToClipboard(link_id) {
 }
 
 function addCopyListener(button_id, link_id) {
-    document.getElementById(button_id)
+    if(document.getElementById(button_id)){
+        document.getElementById(button_id)
             .addEventListener("click", function() {
                 copyLinkToClipboard(link_id);});
+    }
 }
 // @license-end

patrick-canterino.de