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})