Commits

Anonymous committed 6eba7f7

Ported [680] to stable

  • Participants
  • Parent commits f93b89c
  • Branches 0.7-stable

Comments (0)

Files changed (1)

File htdocs/trac.js

 function searchHighlight() {
   if (!document.createElement) return;
 
+  var div = document.getElementById("searchable");
+  if (!div) return;
+
   function getSearchWords(url) {
     if (url.indexOf('?') == -1) return [];
     var queryString = url.substr(url.indexOf('?') + 1);
   var words = getSearchWords(document.URL);
   if (!words.length) words = getSearchWords(document.referrer);
   if (words.length) {
-    var div = document.getElementById("searchable");
     for (var w in words) {
       if (words[w].length) highlightWord(div, words[w], w);
     }