From 48aea41adbae76759c1b56e145ce4b46675586a1 Mon Sep 17 00:00:00 2001 From: Carlos Galarza Date: Wed, 1 Apr 2015 10:16:36 -0500 Subject: [PATCH] Fix sidebar bug Validate if the description is available in the rawSearchIndex --- src/librustdoc/html/static/main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index ca6d944195777..4f8488cca682b 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -713,10 +713,12 @@ if (crates[i] == window.currentCrate) { klass += ' current'; } - var desc = rawSearchIndex[crates[i]].items[0][3]; - div.append($('', {'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($('', {'href': '../' + crates[i] + '/index.html', + 'title': plainSummaryLine(desc), + 'class': klass}).text(crates[i])); + } } sidebar.append(div); }