diff --git a/Projects/Foundations/UI/Function-Libraries/UiObjectsFromNodes.js b/Projects/Foundations/UI/Function-Libraries/UiObjectsFromNodes.js index 91bdfb9bd..1661ad87e 100644 --- a/Projects/Foundations/UI/Function-Libraries/UiObjectsFromNodes.js +++ b/Projects/Foundations/UI/Function-Libraries/UiObjectsFromNodes.js @@ -329,15 +329,22 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() { pathName = rawPath[i][0] pathType = rawPath[i][1] pathNode = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByCodeNameAndNodeType( pathName, pathType ) + // If reference parent is workspace node grab node if (pathType === "Workspace") { pathNode = UI.projects.foundations.spaces.designSpace.workspace.workspaceNode + } + // If Hierarchy Head is not located within the workspace abort reconnection + if (pathNode === undefined) { + console.log("[WARN] Abort reconnection saved path head node not found in current workspace", node) + return } continue } else { // Walk through children nodes and find the next node from saved path pathName = rawPath[i][0] pathType = rawPath[i][1] pathNode = getNextNodeFromPath(pathNode, pathName, pathType) + } } if (pathNode !== undefined ) { @@ -347,6 +354,7 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() { } function getNextNodeFromPath(node, pathName, pathType) { + console.log("pathNode", node) let schemaDocument = getSchemaDocument(node) let nextNode = undefined for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {