From: Robert Griesemer Date: Tue, 3 May 2011 01:07:11 +0000 (-0700) Subject: godoc: if there is no search box, don't run the respective JS code X-Git-Tag: weekly.2011-05-22~164 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8e340695c15715ecd226c047e360d2e58af3f63e;p=gostls13.git godoc: if there is no search box, don't run the respective JS code Fixes a JS crash which prevented the automatically generated table of contents to not appear. R=adg, bradfitz CC=golang-dev https://golang.org/cl/4460041 --- diff --git a/doc/godocs.js b/doc/godocs.js index 2b3ab065ff..20ee36350d 100644 --- a/doc/godocs.js +++ b/doc/godocs.js @@ -28,6 +28,10 @@ function godocs_onload() { function godocs_bindSearchEvents() { var search = document.getElementById('search'); + if (!search) { + // no search box (index disabled) + return; + } function clearInactive() { if (search.className == "inactive") { search.value = "";