diff --git a/assets/js/bibsearch.js b/assets/js/bibsearch.js index 8bc50d835915..8f2f031cb620 100644 --- a/assets/js/bibsearch.js +++ b/assets/js/bibsearch.js @@ -8,6 +8,9 @@ document.addEventListener("DOMContentLoaded", function () { // highlight-search-term if (CSS.highlights) { const nonMatchingElements = highlightSearchTerm({ search: searchTerm, selector: ".bibliography > li" }); + if (nonMatchingElements == null) { + return; + } nonMatchingElements.forEach((element) => { element.classList.add("unloaded"); });