From e578d93c93a91d6c377ab162cd97c35eb3ea816f Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 15 Sep 2020 20:50:29 +0200 Subject: [PATCH] Bug Fixes --- .../FunctionLibraries/CryptoEcosystemFunctions.js | 14 ++++++++++++-- Utilities/Meshes.js | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js b/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js index 544347a5e..f7503e608 100644 --- a/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js +++ b/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js @@ -377,9 +377,19 @@ function newCryptoEcosystemFunctions() { for (let i = 0; i < timeMachines.length; i++) { let timeMachine = timeMachines[i] let session = timeMachine.payload.referenceParent - if (session === undefined) {continue} + if (session === undefined) { + /* + This is what usually happens, that the intall process make these + time machines to lose their reference parent since the install + process deletes them. + */ + functionLibraryNodeDeleter.deleteUIObject(timeMachine, rootNodes) + continue + } let marketTradingTasks = findNodeInNodeMesh(session, 'Market Trading Tasks', undefined, true, false, true, false) - if (marketTradingTasks.payload.referenceParent === undefined) {continue} + if (marketTradingTasks === undefined) {continue} + if (marketTradingTasks.payload === undefined) {continue} + if (marketTradingTasks.payload.referenceParent === undefined) { continue } if (marketTradingTasks.payload.referenceParent.id === market.id) { functionLibraryNodeDeleter.deleteUIObject(timeMachine, rootNodes) } diff --git a/Utilities/Meshes.js b/Utilities/Meshes.js index f0d474ff9..44144bf95 100644 --- a/Utilities/Meshes.js +++ b/Utilities/Meshes.js @@ -11,6 +11,7 @@ function findNodeInNodeMesh(node, nodeType, nodeName, connectedViaPayload, findI function scanNodeMesh(startingNode, depth) { if (startingNode === undefined) { return } + if (startingNode.payload === undefined) { return } if (nodeFound !== undefined) { return } if (depth >= MAX_DEPTH) {return}