Skip to content

Commit 7c2dba8

Browse files
committed
safer check for result.children
`("children" in result) && result.children.length` fails if children is explicitly null.
1 parent 281f314 commit 7c2dba8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@
692692

693693
result=results[i];
694694
selectable=id(result) !== undefined;
695-
compound=("children" in result) && result.children.length > 0;
695+
compound=result.children && result.children.length > 0;
696696

697697
node=$("<li></li>");
698698
node.addClass("select2-results-dept-"+depth);

0 commit comments

Comments
 (0)