Merge pull request #8131 from minrk/sort-help

handle undefined when sorting quick help
This commit is contained in:
Thomas Kluyver 2015-03-23 18:06:28 -07:00
commit 25415547fb

View File

@ -244,13 +244,13 @@ define([
}
}
help.sort(function (a, b) {
if (a.help_index > b.help_index){
if (a.help_index === b.help_index) {
return 0;
}
if (a.help_index === undefined || a.help_index > b.help_index){
return 1;
}
if (a.help_index < b.help_index){
return -1;
}
return 0;
return -1;
});
return help;
};