Skip to content
Snippets Groups Projects
Commit 839b48a1 authored by Xiao Gui's avatar Xiao Gui Committed by xgui3783
Browse files

bugfix: tree search pipe crashes when getchildren returns null

parent 3de2ac66
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,9 @@ export class TreeSearchPipe implements PipeTransform{
public transform(array:any[]|null,filterFn:(item:any)=>boolean,getChildren:(item:any)=>any[]):any[]{
const transformSingle = (item:any):boolean=>
filterFn(item) ||
getChildren(item).some(transformSingle)
(getChildren(item)
? getChildren(item).some(transformSingle)
: false)
return array
? array.filter(transformSingle)
: []
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment