Bugfix: filter not null

This commit is contained in:
cgfhtw
2024-05-22 08:54:23 +02:00
parent b52ea08013
commit 5eafa6b5f4
@@ -37,7 +37,7 @@ export default {
let res = arr.filter(n => n.key == key);
if (res.length)
return res.pop();
res = arr.map(n => n.children ? this.findNodeByKey(key, n.children) : null).filter();
res = arr.map(n => n.children ? this.findNodeByKey(key, n.children) : null).filter(a => a);
if (res.length)
return res.pop();
return null;