From bdf1860c72330a143425db26953985bf0c52a6ef Mon Sep 17 00:00:00 2001 From: hpinkos Date: Fri, 14 Jul 2017 08:59:35 -0400 Subject: [PATCH] Fixes #5607 --- CHANGES.md | 1 + .../Cesium3DTilesInspectorViewModel.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0e9176c17f89..169804a9751f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Change Log * Added ability to show tile urls in the 3D Tiles Inspector. [#5592](https://github.com/AnalyticalGraphicsInc/cesium/pull/5592) * Added behavior to `Cesium3DTilesInspector` that selects the first tileset hovered over if no tilest is specified. [#5139](https://github.com/AnalyticalGraphicsInc/cesium/issues/5139) * Added ability to provide a `width` and `height` to `scene.pick`. [#5602](https://github.com/AnalyticalGraphicsInc/cesium/pull/5602) +* Fixed crash when using the `Cesium3DTilesInspectorViewModel` and removing a tileset [#5607](https://github.com/AnalyticalGraphicsInc/cesium/issues/5607) ### 1.35.2 - 2017-07-11 diff --git a/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js b/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js index 64242f77f456..b58d82ec377d 100644 --- a/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js +++ b/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js @@ -1010,7 +1010,7 @@ define([ return; } var currentFeature = this._feature; - if (defined(currentFeature)) { + if (defined(currentFeature) && !currentFeature.content.isDestroyed()) { // Restore original color to feature that is no longer selected var frameState = this._scene.frameState; if (!this.colorize && defined(this._style)) { @@ -1043,7 +1043,7 @@ define([ } var currentTile = this._tile; - if (defined(currentTile) && !hasFeatures(currentTile.content)) { + if (defined(currentTile) && !currentTile.isDestroyed() && !hasFeatures(currentTile.content)) { // Restore original color to tile that is no longer selected currentTile.color = oldColor; } @@ -1225,6 +1225,13 @@ define([ } if (defined(tileset)) { + if (tileset.isDestroyed()) { + this.tile = undefined; + this.feature = undefined; + this.tileset = undefined; + return; + } + var style = tileset.style; if (this._style !== tileset.style) { if (this._shouldStyle) {