[BUGFIX] Prevent addCopyListener to add event on undefined button when preview option set to false

This commit is contained in:
sebastien 2019-10-15 15:07:36 +02:00 committed by Jerome Jutteau
parent 08efa741a5
commit 96f7e6adb9

View 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