Merge pull request #90505 from aaronp64/gltfdocument_crash

Fix `GLTFDocument.append_from_scene` crash on null node
This commit is contained in:
Rémi Verschelde 2024-04-11 11:02:57 +02:00
commit 2e5d2333b7
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -7284,6 +7284,7 @@ Node *GLTFDocument::generate_scene(Ref<GLTFState> p_state, float p_bake_fps, boo
} }
Error GLTFDocument::append_from_scene(Node *p_node, Ref<GLTFState> p_state, uint32_t p_flags) { Error GLTFDocument::append_from_scene(Node *p_node, Ref<GLTFState> p_state, uint32_t p_flags) {
ERR_FAIL_NULL_V(p_node, FAILED);
Ref<GLTFState> state = p_state; Ref<GLTFState> state = p_state;
ERR_FAIL_COND_V(state.is_null(), FAILED); ERR_FAIL_COND_V(state.is_null(), FAILED);
state->use_named_skin_binds = p_flags & GLTF_IMPORT_USE_NAMED_SKIN_BINDS; state->use_named_skin_binds = p_flags & GLTF_IMPORT_USE_NAMED_SKIN_BINDS;