diff --git a/src/main/js/add-item.js b/src/main/js/add-item.js index 57fffc89d8..3b0e98c1cd 100644 --- a/src/main/js/add-item.js +++ b/src/main/js/add-item.js @@ -106,9 +106,12 @@ document.addEventListener("DOMContentLoaded", () => { } function cleanCopyFromOption() { - document - .querySelector('#createItem input[type="radio"][value="copy"]') - .removeAttribute("checked"); + const copyRadio = document.querySelector( + '#createItem input[type="radio"][value="copy"]', + ); + if (copyRadio) { + copyRadio.removeAttribute("checked"); + } document.querySelector( '#createItem input[type="text"][name="from"]', ).value = "";