From d4c90e36392dafe4061b39213b1760abb5ace429 Mon Sep 17 00:00:00 2001 From: Omar Shehata Date: Fri, 31 Aug 2018 11:24:26 -0400 Subject: [PATCH] Add error if not loaded --- Source/Scene/Cesium3DTileset.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index c183104d7fb8..d6f9518b5ea4 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -1247,6 +1247,8 @@ define([ * * @memberof Cesium3DTileset.prototype * + * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true. + * * @type {*} * @readonly * @@ -1254,6 +1256,12 @@ define([ */ extras : { get : function() { + //>>includeStart('debug', pragmas.debug); + if (!this.ready) { + throw new DeveloperError('The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.'); + } + //>>includeEnd('debug'); + return this._extras; } }