1
0
mirror of synced 2025-02-04 14:19:23 +03:00

safer check for result.children

`("children" in result) && result.children.length` fails if children is explicitly null.
This commit is contained in:
Mark DiMarco 2012-09-06 16:55:04 -05:00
parent 281f314fd7
commit 7c2dba8fe0

View File

@ -692,7 +692,7 @@
result=results[i]; result=results[i];
selectable=id(result) !== undefined; selectable=id(result) !== undefined;
compound=("children" in result) && result.children.length > 0; compound=result.children && result.children.length > 0;
node=$("<li></li>"); node=$("<li></li>");
node.addClass("select2-results-dept-"+depth); node.addClass("select2-results-dept-"+depth);