mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-02-22 02:41:23 +01:00
fix nullref in layoutNode.findNode
This commit is contained in:
parent
755f8f2385
commit
7d90a3912b
@ -111,6 +111,7 @@ export function removeChild(parent: LayoutNode, childToRemove: LayoutNode, start
|
||||
* @returns The node with the given id or undefined if no node with the given id was found.
|
||||
*/
|
||||
export function findNode(node: LayoutNode, id: string): LayoutNode | undefined {
|
||||
if (!node) return;
|
||||
if (node.id === id) return node;
|
||||
if (!node.children) return;
|
||||
for (const child of node.children) {
|
||||
|
Loading…
Reference in New Issue
Block a user