V8: Fix JS error when using the hide search function in treepicker (#6931)

* Fix JS error when using the hide search function in treepicker

* updates with same defensive change from original pr - only explores child.children after confirming the child indeed has children

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
This commit is contained in:
Kenn Jacobsen
2021-08-02 01:26:30 +02:00
committed by GitHub
parent d537545fa9
commit d40e503c82

View File

@@ -574,6 +574,8 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
var listViewResults = vm.searchInfo.selectedSearchResults.filter(i => i.parentId === child.id);
listViewResults.forEach(item => {
if (!child.children) return;
var childExists = child.children.find(c => c.id === item.id);
if (!childExists) {