Rollup merge of #23941 - carloslfu:patch-1, r=steveklabnik

Validate if the description is available in the rawSearchIndex
This commit is contained in:
Manish Goregaokar 2015-04-04 10:54:24 +05:30
commit 9fc7a1e860
1 changed files with 6 additions and 4 deletions

View File

@ -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);
}