From d1d9afde641525acaf8a271d11cd35ad55b019ce Mon Sep 17 00:00:00 2001 From: Robert Long <robert@robertlong.me> Date: Fri, 3 Aug 2018 09:07:19 -0700 Subject: [PATCH] Ensure we throw an error when loading a gltf model. --- src/components/gltf-model-plus.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/gltf-model-plus.js b/src/components/gltf-model-plus.js index 3167eefc0..71937c746 100644 --- a/src/components/gltf-model-plus.js +++ b/src/components/gltf-model-plus.js @@ -374,7 +374,8 @@ AFRAME.registerComponent("gltf-model-plus", { GLTFCache[src] = loadGLTF(src, this.data.basePath, this.data.contentType, this.preferredTechnique); } - const model = await GLTFCache[src].then(cloneGltf); + const cachedModel = await GLTFCache[src]; + const model = cloneGltf(cachedModel); // If we started loading something else already // TODO: there should be a way to cancel loading instead -- GitLab