Skip to content

Commit

Permalink
Fix sidebar bug
Browse files Browse the repository at this point in the history
Validate if the description is available in the rawSearchIndex
  • Loading branch information
carloslfu committed Apr 1, 2015
1 parent 8943653 commit 48aea41
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,12 @@
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);
}
Expand Down

0 comments on commit 48aea41

Please sign in to comment.