Skip to content

Commit 0b6eb87

Browse files
authored
Safe guard exdoc:autocomplete-limit meta access (#2142)
Can be seen in a few places in browser console, f.ex. https://hexdocs.pm/phoenix/overview.html Error: Uncaught TypeError: can't access property "content", document.querySelector(...) is null
1 parent 32bfa72 commit 0b6eb87

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

assets/js/search-bar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function focusSearchInput () {
6262

6363
function setAutocompleteLimit () {
6464
const searchInput = qs(SEARCH_INPUT_SELECTOR)
65-
const autocompleteLimit = parseInt(document.querySelector('meta[name="exdoc:autocomplete-limit"]').content)
65+
const autocompleteLimit = parseInt(document.querySelector('meta[name="exdoc:autocomplete-limit"]')?.content)
6666
if (autocompleteLimit) {
6767
window.autocompleteLimit = autocompleteLimit
6868
}

formatters/html/dist/html-Y223O6DN.js renamed to formatters/html/dist/html-VHCRJ6TI.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)