Skip to content

Commit

Permalink
safer check for result.children
Browse files Browse the repository at this point in the history
`("children" in result) && result.children.length` fails if children is explicitly null.
  • Loading branch information
markmarkoh committed Sep 6, 2012
1 parent 281f314 commit 7c2dba8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion select2.js
Expand Up @@ -692,7 +692,7 @@

result=results[i];
selectable=id(result) !== undefined;
compound=("children" in result) && result.children.length > 0;
compound=result.children && result.children.length > 0;

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

0 comments on commit 7c2dba8

Please sign in to comment.