From 178a0cde926c62ec97b95008adf1279446955f05 Mon Sep 17 00:00:00 2001 From: inventivetalent Date: Mon, 6 Nov 2023 13:56:27 +0100 Subject: [PATCH] don't add undefined assets --- src/UVMapper.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/UVMapper.ts b/src/UVMapper.ts index 2ca22863..a2660aa1 100644 --- a/src/UVMapper.ts +++ b/src/UVMapper.ts @@ -259,10 +259,14 @@ export class UVMapper { uniqueTextureNames.push(textureKey); const assetKey = AssetKey.parse("textures", textureValue, model.key); promises.push(ModelTextures.get(assetKey).then(asset => { - textureMap[textureKey] = new WrappedImage(asset!); + if (asset) { + textureMap[textureKey] = new WrappedImage(asset); + } })); promises.push(ModelTextures.getMeta(assetKey).then(meta => { - metaMap[textureKey] = meta; + if (meta) { + metaMap[textureKey] = meta; + } })) } }