ui: NavigationTree: do not modify list while iterating
iterating over a nodeinterfaces children while removing them will lead to 'child' being undefined instead collect the children to remove in a separate list and iterate over them Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
6396bace3d
commit
3c5b523631
@ -188,11 +188,13 @@ Ext.define('PBS.view.main.NavigationTree', {
|
||||
}
|
||||
}
|
||||
|
||||
let toremove = [];
|
||||
list.eachChild((child) => {
|
||||
if (!newSet[child.data.path]) {
|
||||
list.removeChild(child, true);
|
||||
toremove.push(child);
|
||||
}
|
||||
});
|
||||
toremove.forEach((child) => list.removeChild(child, true));
|
||||
|
||||
if (view.pathToSelect !== undefined) {
|
||||
let path = view.pathToSelect;
|
||||
|
Loading…
Reference in New Issue
Block a user