]> git.lizzy.rs Git - rust.git/commitdiff
Fix sidebar bug
authorCarlos Galarza <carloslfu@gmail.com>
Wed, 1 Apr 2015 15:16:36 +0000 (10:16 -0500)
committerCarlos Galarza <carloslfu@gmail.com>
Wed, 1 Apr 2015 15:16:36 +0000 (10:16 -0500)
Validate if the description is available in the rawSearchIndex

src/librustdoc/html/static/main.js

index ca6d9441957777a4e187703df16167fe78a9a84b..4f8488cca682b0d7679b962de0150b1971829a8f 100644 (file)
                 if (crates[i] == window.currentCrate) {
                     klass += ' current';
                 }
-                var desc = rawSearchIndex[crates[i]].items[0][3];
-                div.append($('<a>', {'href': '../' + crates[i] + '/index.html',
-                                     'title': plainSummaryLine(desc),
-                                     'class': klass}).text(crates[i]));
+                if (rawSearchIndex[crates[i]].items[0]) {
+                    var desc = rawSearchIndex[crates[i]].items[0][3];
+                    div.append($('<a>', {'href': '../' + crates[i] + '/index.html',
+                                         'title': plainSummaryLine(desc),
+                                         'class': klass}).text(crates[i]));
+                }
             }
             sidebar.append(div);
         }