Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit befcaa9

Browse files
committed
Merge pull request ipython#8131 from minrk/sort-help
handle undefined when sorting quick help
2 parents 9f18689 + 320fde2 commit befcaa9

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

IPython/html/static/base/js/keyboard.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,13 @@ define([
244244
}
245245
}
246246
help.sort(function (a, b) {
247-
if (a.help_index > b.help_index){
248-
return 1;
247+
if (a.help_index === b.help_index) {
248+
return 0;
249249
}
250-
if (a.help_index < b.help_index){
251-
return -1;
250+
if (a.help_index === undefined || a.help_index > b.help_index){
251+
return 1;
252252
}
253-
return 0;
253+
return -1;
254254
});
255255
return help;
256256
};

0 commit comments

Comments
 (0)