From befcaa9a61887207be282daef86129e5544d0fcb 2015-03-24 01:06:28 From: Thomas Kluyver Date: 2015-03-24 01:06:28 Subject: [PATCH] Merge pull request #8131 from minrk/sort-help handle undefined when sorting quick help --- diff --git a/IPython/html/static/base/js/keyboard.js b/IPython/html/static/base/js/keyboard.js index 474b240..fe02abb 100644 --- a/IPython/html/static/base/js/keyboard.js +++ b/IPython/html/static/base/js/keyboard.js @@ -244,13 +244,13 @@ define([ } } help.sort(function (a, b) { - if (a.help_index > b.help_index){ - return 1; + if (a.help_index === b.help_index) { + return 0; } - if (a.help_index < b.help_index){ - return -1; + if (a.help_index === undefined || a.help_index > b.help_index){ + return 1; } - return 0; + return -1; }); return help; };