We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0f6318 commit e179733Copy full SHA for e179733
src/model.ts
@@ -285,9 +285,12 @@ class ModelManager {
285
const version = this.checkModelVersion(modelSetting);
286
if (version === 2) {
287
const textureCache = await this.loadTextureCache(modelName);
288
- let textures = textureCache[this.modelTexturesId];
289
- if (typeof textures === 'string') textures = [textures];
290
- modelSetting.textures = textures;
+ // this.loadTextureCache may return an empty array
+ if (textureCache.length > 0) {
+ let textures = textureCache[this.modelTexturesId];
291
+ if (typeof textures === 'string') textures = [textures];
292
+ modelSetting.textures = textures;
293
+ }
294
}
295
} else {
296
modelSettingPath = this.models[this.modelId].paths[this.modelTexturesId];
0 commit comments