From 9886af3cec24cc2ff4b10182dc274a546915ae1e Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 29 Apr 2021 14:09:21 +0100 Subject: [PATCH] Fix jshint error in treeList --- .../editor-client/src/js/ui/common/treeList.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js index df9592508..7f7eba1ba 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js @@ -350,10 +350,12 @@ delete that._items[item.id]; if(item.depth === 0) { for(var key in that._items) { - var child = that._items[key]; - if(child.parent && child.parent.id === item.id) { - delete that._items[key].treeList; - delete that._items[key]; + if (that._items.hasOwnProperty(key)) { + var child = that._items[key]; + if(child.parent && child.parent.id === item.id) { + delete that._items[key].treeList; + delete that._items[key]; + } } } that._data = that._data.filter(function(data) { return data.id !== item.id})