From 79fc523d9cda39b0b0fc88769fb2a7a5cebb4a1c Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Tue, 6 Aug 2024 10:26:53 +0100 Subject: [PATCH] chore(viewer): adds logger for the case, as per king alex's request --- .../viewer/src/modules/loaders/Speckle/SpeckleConverter.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/viewer/src/modules/loaders/Speckle/SpeckleConverter.ts b/packages/viewer/src/modules/loaders/Speckle/SpeckleConverter.ts index f3eb4ef6b..043fe229d 100644 --- a/packages/viewer/src/modules/loaders/Speckle/SpeckleConverter.ts +++ b/packages/viewer/src/modules/loaders/Speckle/SpeckleConverter.ts @@ -608,7 +608,12 @@ export default class SpeckleConverter { const speckleData = this.instancedObjectsLookupTable[objectApplicationId] // NOTE: see https://linear.app/speckle/issue/CNX-115/viewer-handle-gracefully-instances-with-elements-that-failed-to // This prevents the viewer not loading anything if a instance component is missing from its defintion. This is a likely scenario from connectors; even though we're guarding against it we'll never be able to fully enforce it. - if (!speckleData) continue + if (!speckleData) { + Logger.warn( + `Object ${objectApplicationId} is is missing from definition ${definitionId}. Someone probably sent an instance containing unsopprted elements - this is ok, do not panic.` + ) + continue + } const instancedNode = this.tree.parse({ id: this.getCompoundId(speckleData.id, this.instanceCounter++), raw: speckleData,