Permalink
Browse files

safer check for result.children

`("children" in result) && result.children.length` fails if children is explicitly null.
  • Loading branch information...
1 parent 281f314 commit 7c2dba8fe0e3fed262e98e73939fd8128b601b82 @markmarkoh markmarkoh committed Sep 6, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 select2.js
View
@@ -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);

0 comments on commit 7c2dba8

Please sign in to comment.