From 648e038d60a8f0d8c15dc8d62b81bcc22a320aeb Mon Sep 17 00:00:00 2001 From: luzhuang <364439895@qq.com> Date: Wed, 1 Sep 2021 19:17:07 +0800 Subject: [PATCH] fix: bugfix --- packages/loader/src/scene-loader/resources/GLTFResource.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/loader/src/scene-loader/resources/GLTFResource.ts b/packages/loader/src/scene-loader/resources/GLTFResource.ts index d77417b577..04334b13a3 100644 --- a/packages/loader/src/scene-loader/resources/GLTFResource.ts +++ b/packages/loader/src/scene-loader/resources/GLTFResource.ts @@ -113,7 +113,7 @@ export class GLTFResource extends SchemaResource { newMaterial.push(matStructure); }); }); - const loadAttachedController = animatorControllerLoadPromise.then((res) => { + const loadAttachedController = animatorControllerLoadPromise ? animatorControllerLoadPromise.then((res) => { const { animatorControllers } = result.structure.props; const controllerStructure = res.structure; const controllerResource = res.resources[controllerStructure.index]; @@ -129,7 +129,7 @@ export class GLTFResource extends SchemaResource { } } animatorControllers.push(controllerStructure); - }); + }) : Promise.resolve(); Promise.all([loadAttachedMaterial, loadAttachedController]).then(() => { resolve(result); });