diff --git a/src/client/search.js b/src/client/search.js index 60bd9111e..7e55663ca 100644 --- a/src/client/search.js +++ b/src/client/search.js @@ -44,7 +44,7 @@ input.addEventListener("input", () => { : `
${results.length.toLocaleString("en-US")} result${ results.length === 1 ? "" : "s" }
    ${renderResults(results)}
`; - resultsContainer.querySelector(`.${activeClass}`).scrollIntoView({block: "nearest"}); + resultsContainer.querySelector(`.${activeClass}`)?.scrollIntoView({block: "nearest"}); }); function renderResults(results) {