Skip to content

Commit

Permalink
don't add undefined assets
Browse files Browse the repository at this point in the history
  • Loading branch information
InventivetalentDev committed Nov 6, 2023
1 parent bb13b76 commit 178a0cd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/UVMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}))
}
}
Expand Down

0 comments on commit 178a0cd

Please sign in to comment.