Skip to content

Commit

Permalink
search.js: check for search-input element early (#32100)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Nov 10, 2020
1 parent 30fbd0a commit 21f079f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions site/docs/4.5/assets/js/src/search.js
Expand Up @@ -5,11 +5,12 @@
(function () {
'use strict'

if (!window.docsearch) {
var inputElement = document.getElementById('search-input')

if (!window.docsearch || !inputElement) {
return
}

var inputElement = document.getElementById('search-input')
var siteDocsVersion = inputElement.getAttribute('data-docs-version')

function getOrigin() {
Expand Down

0 comments on commit 21f079f

Please sign in to comment.