Skip to content

Commit

Permalink
Merge pull request #50764 from AndreaCatania/AndreaCatania-patch-4
Browse files Browse the repository at this point in the history
Fix GLTF crash when the material is not set.
  • Loading branch information
akien-mga committed Jul 23, 2021
2 parents 995093f + 2cd347f commit 78dae32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/gltf/gltf_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2796,7 +2796,7 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) {
mat = mat3d;
}

import_mesh->add_surface(primitive, array, morphs, Dictionary(), mat, mat->get_name());
import_mesh->add_surface(primitive, array, morphs, Dictionary(), mat, mat.is_valid() ? mat->get_name() : String());
}

Vector<float> blend_weights;
Expand Down

0 comments on commit 78dae32

Please sign in to comment.