From 4ca5c7dce0ff13ecf7ad6243e07928a1a8d7ebb9 Mon Sep 17 00:00:00 2001 From: Benjamin Storrier Date: Thu, 14 Jul 2022 16:13:05 +1000 Subject: [PATCH] Fix getNodeDataAtTreeIndexOrNextIndex for when node is undefined --- src/utils/tree-data-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/tree-data-utils.ts b/src/utils/tree-data-utils.ts index 5a6e1913..6380815f 100644 --- a/src/utils/tree-data-utils.ts +++ b/src/utils/tree-data-utils.ts @@ -61,7 +61,7 @@ const getNodeDataAtTreeIndexOrNextIndex = ({ } // Add one and continue for nodes with no children or hidden children - if (!node.children || (ignoreCollapsed && node.expanded !== true)) { + if (!node?.children || (ignoreCollapsed && node?.expanded !== true)) { return { nextIndex: currentIndex + 1 } }