Skip to content

Commit

Permalink
Rollup merge of rust-lang#23941 - carloslfu:patch-1, r=steveklabnik
Browse files Browse the repository at this point in the history
Validate if the description is available in the rawSearchIndex
  • Loading branch information
Manishearth committed Apr 3, 2015
2 parents 819dc66 + 48aea41 commit cdc5187
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 cdc5187

Please sign in to comment.