diff --git a/modules/gltf/gltf_state.cpp b/modules/gltf/gltf_state.cpp index 667b5e5c89..de1ea267b0 100644 --- a/modules/gltf/gltf_state.cpp +++ b/modules/gltf/gltf_state.cpp @@ -480,6 +480,7 @@ GLTFBufferViewIndex GLTFState::append_data_to_buffers(const Vector &p_d } GLTFNodeIndex GLTFState::append_gltf_node(Ref p_gltf_node, Node *p_godot_scene_node, GLTFNodeIndex p_parent_node_index) { + ERR_FAIL_COND_V(p_gltf_node.is_null(), GLTFNodeIndex(0)); p_gltf_node->set_parent(p_parent_node_index); const GLTFNodeIndex new_index = nodes.size(); nodes.append(p_gltf_node);