Skip to content

Commit

Permalink
Refactor #7237
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Feb 13, 2019
1 parent 15ed451 commit 2f4c7ce
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/app/components/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,10 @@ export class Tree implements OnInit,AfterContentInit,OnDestroy,BlockableUI {

if (this.hasFilteredNodes()) {
node = this.getNodeWithKey(node.key, this.value);

if (!node) {
return;
}
}

let index = this.findIndexInSelection(node);
Expand Down Expand Up @@ -784,11 +788,12 @@ export class Tree implements OnInit,AfterContentInit,OnDestroy,BlockableUI {
}

if (node.children) {
return this.getNodeWithKey(key, node.children);
let matchedNode = this.getNodeWithKey(key, node.children);
if (matchedNode) {
return matchedNode;
}
}
}

return null;
}

propagateUp(node: TreeNode, select: boolean) {
Expand Down

0 comments on commit 2f4c7ce

Please sign in to comment.