From 9f0e09663baac35bca76de4b7f6dcbd305da0e99 Mon Sep 17 00:00:00 2001 From: RomanenkoVladimir Date: Fri, 27 Nov 2020 23:19:56 +0100 Subject: [PATCH] Fix tests --- .../ui/codeMap/threeViewer/threeSceneService.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/visualization/app/codeCharta/ui/codeMap/threeViewer/threeSceneService.ts b/visualization/app/codeCharta/ui/codeMap/threeViewer/threeSceneService.ts index c5251d32f9..87a98a7f0d 100755 --- a/visualization/app/codeCharta/ui/codeMap/threeViewer/threeSceneService.ts +++ b/visualization/app/codeCharta/ui/codeMap/threeViewer/threeSceneService.ts @@ -64,8 +64,10 @@ export class ThreeSceneService implements CodeMapPreRenderServiceSubscriber { highlightBuildings() { const state = this.storeService.getState() this.getMapMesh().highlightBuilding(this.highlighted, this.selected, state, this.constantHighlight) - this.updateCorrectMaterial(this.mapGeometry.children[0]["material"], this.highlighted, false) - if (this.selected) this.updateCorrectMaterial(this.mapGeometry.children[0]["material"], [this.selected], true) + if (this.mapGeometry.children[0]) { + this.updateCorrectMaterial(this.mapGeometry.children[0]["material"], this.highlighted, false) + if (this.selected) this.updateCorrectMaterial(this.mapGeometry.children[0]["material"], [this.selected], true) + } } highlightBuildingsAfterSelect() { @@ -129,7 +131,9 @@ export class ThreeSceneService implements CodeMapPreRenderServiceSubscriber { clearHighlight() { if (this.getMapMesh()) { this.getMapMesh().clearHighlight(this.selected) - this.resetHighlightMaterial(this.mapGeometry.children[0]["material"]) + if (this.mapGeometry.children[0]) { + this.resetHighlightMaterial(this.mapGeometry.children[0]["material"]) + } this.highlighted = [] this.constantHighlight.clear() }