Skip to content

Commit

Permalink
Check variants for undefined values
Browse files Browse the repository at this point in the history
  • Loading branch information
UX3D-haertl committed Feb 4, 2025
1 parent 30d38be commit b2664a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/logic/uimodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class UIModel
this.app.selectedAnimations = state.animationIndices;

if (gltf && gltf.variants) {
this.app.materialVariants = ["None", ...gltf.variants.map(variant => variant.name)];
this.app.materialVariants = ["None", ...gltf.variants.map(variant => variant?.name ?? "Unnamed")];
} else {
this.app.materialVariants = ["None"];
}
Expand Down

0 comments on commit b2664a0

Please sign in to comment.