diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js index 7cfe5ef62d2..a6af7f8df7a 100644 --- a/themes/bootstrap3/js/record.js +++ b/themes/bootstrap3/js/record.js @@ -196,6 +196,9 @@ function registerTabEvents() { // Update print button to correct tab prints function setPrintBtnHash(hash) { let printBtn = document.querySelector(".print-record"); + if (!printBtn) { + return; + } let printHref = printBtn.getAttribute("href"); let printURL = new URL(printHref, window.location.origin); printURL.hash = hash === null ? "" : hash; diff --git a/themes/bootstrap5/js/record.js b/themes/bootstrap5/js/record.js index 7cfe5ef62d2..a6af7f8df7a 100644 --- a/themes/bootstrap5/js/record.js +++ b/themes/bootstrap5/js/record.js @@ -196,6 +196,9 @@ function registerTabEvents() { // Update print button to correct tab prints function setPrintBtnHash(hash) { let printBtn = document.querySelector(".print-record"); + if (!printBtn) { + return; + } let printHref = printBtn.getAttribute("href"); let printURL = new URL(printHref, window.location.origin); printURL.hash = hash === null ? "" : hash;