From c19420607f85dad3329b4b323b0359030c883303 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Thu, 1 Nov 2018 11:51:33 -0400 Subject: [PATCH] Check if cartographic is defined before getting height --- Source/Scene/Cesium3DTileset.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 7e0800a42d89..e0449e75ae1b 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -750,8 +750,8 @@ define([ // we want to apply an ENU orientation as our best guess of orientation. // Otherwise, we assume it gets its position/orientation completely from the // root tile transform and the tileset's model matrix - var heightAboveEllipsoid = that._ellipsoid.cartesianToCartographic(clippingPlanesOrigin).height; - if (heightAboveEllipsoid > ApproximateTerrainHeights._defaultMinTerrainHeight) { + var originCartographic = that._ellipsoid.cartesianToCartographic(clippingPlanesOrigin); + if (defined(originCartographic) && (originCartographic.height > ApproximateTerrainHeights._defaultMinTerrainHeight)) { that._initialClippingPlanesOriginMatrix = Transforms.eastNorthUpToFixedFrame(clippingPlanesOrigin); } that._clippingPlanesOriginMatrix = Matrix4.clone(that._initialClippingPlanesOriginMatrix);