Fix sidebar bug

Validate if the description is available in the rawSearchIndex
This commit is contained in:
Carlos Galarza 2015-04-01 10:16:36 -05:00
parent 8943653624
commit 48aea41adb
1 changed files with 6 additions and 4 deletions

View File

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