diff --git a/e2e/tests/functional/tree.e2e.spec.js b/e2e/tests/functional/tree.e2e.spec.js index d1020f9512..23798be139 100644 --- a/e2e/tests/functional/tree.e2e.spec.js +++ b/e2e/tests/functional/tree.e2e.spec.js @@ -50,7 +50,6 @@ test.describe('Main Tree', () => { await expandTreePaneItemByName(page, folder.name); await assertTreeItemIsVisible(page, clock.name); - }); test('Creating a child object on one tab and expanding its parent on the other shows the correct composition @2p', async ({ page, openmctConfig }) => { diff --git a/src/ui/layout/mct-tree.vue b/src/ui/layout/mct-tree.vue index 2314f68337..5c50622135 100644 --- a/src/ui/layout/mct-tree.vue +++ b/src/ui/layout/mct-tree.vue @@ -450,13 +450,14 @@ export default { }, Promise.resolve()).then(() => { if (this.isSelectorTree) { + let item = this.getTreeItemByPath(navigationPath); // If item is missing due to error in object creation, // walk up the navigationPath until we find an item - let item = this.getTreeItemByPath(navigationPath); - while (!item) { + while (!item && navigationPath !== '') { const startIndex = 0; const endIndex = navigationPath.lastIndexOf('/'); navigationPath = navigationPath.substring(startIndex, endIndex); + item = this.getTreeItemByPath(navigationPath); }