From 83372f2df02d3863f06324e41b6002c890b19ddc Mon Sep 17 00:00:00 2001 From: Aaron Beall Date: Wed, 8 Feb 2023 11:06:17 -0500 Subject: [PATCH 1/2] Added null check --- handsontable/src/plugins/nestedRows/data/dataManager.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/handsontable/src/plugins/nestedRows/data/dataManager.js b/handsontable/src/plugins/nestedRows/data/dataManager.js index de2ed140e7c..ea99828c19c 100644 --- a/handsontable/src/plugins/nestedRows/data/dataManager.js +++ b/handsontable/src/plugins/nestedRows/data/dataManager.js @@ -105,9 +105,11 @@ class DataManager { nodeInfo: new WeakMap() }; - rangeEach(0, this.data.length - 1, (i) => { - this.cacheNode(this.data[i], 0, null); - }); + if (this.data) { + rangeEach(0, this.data.length - 1, (i) => { + this.cacheNode(this.data[i], 0, null); + }); + } } /** From 85669c901c47b244e8a5a179da352dfa212b542b Mon Sep 17 00:00:00 2001 From: Aaron Beall Date: Wed, 15 Feb 2023 14:40:39 -0500 Subject: [PATCH 2/2] Added null check --- handsontable/src/plugins/nestedRows/ui/collapsing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handsontable/src/plugins/nestedRows/ui/collapsing.js b/handsontable/src/plugins/nestedRows/ui/collapsing.js index 971709f3450..e7010598601 100644 --- a/handsontable/src/plugins/nestedRows/ui/collapsing.js +++ b/handsontable/src/plugins/nestedRows/ui/collapsing.js @@ -77,7 +77,7 @@ class CollapsingUI extends BaseUI { rowIndex = row; } - if (this.dataManager.hasChildren(rowObject)) { + if (rowObject && this.dataManager.hasChildren(rowObject)) { arrayEach(rowObject.__children, (elem) => { rowsToCollapse.push(this.dataManager.getRowIndex(elem)); });