Browse Source

Update babylon.node.ts

Fixing the === null reference
Raanan Weber 9 years ago
parent
commit
6eaeb25a75
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/babylon.node.ts

+ 1 - 1
src/babylon.node.ts

@@ -186,7 +186,7 @@
         public _getDescendants(list: Node[], results: Node[], directDecendantsOnly: boolean = false, predicate?: (node: Node) => boolean): void {
             for (var index = 0; index < list.length; index++) {
                 var item = list[index];
-                if (((directDecendantsOnly && item.parent === this) || (!directDecendantsOnly && item.isDescendantOf(this))) && (predicate === null || predicate(item))) {
+                if (((directDecendantsOnly && item.parent === this) || (!directDecendantsOnly && item.isDescendantOf(this))) && (!predicate || predicate(item))) {
                     results.push(item);
                 }
             }