summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Fertyk <pfertyk@pfertyk.me>2022-01-25 00:48:12 +0100
committerPaweł Fertyk <pfertyk@pfertyk.me>2022-01-25 00:48:12 +0100
commit12d0ff1a4dbf244f35dc688122e649b2cb916497 (patch)
treefc848a6174922821b1c46cd1fa46dd609692d5f5
parent30701e3966fe0869868d09d57249ff140e55849e (diff)
Issue 57130 Fix GLTFDocument.generate_scene if state is null
-rw-r--r--modules/gltf/gltf_document.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index 5a931ed839..51608273a1 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -6843,6 +6843,7 @@ Error GLTFDocument::write_to_filesystem(Ref<GLTFState> state, const String &p_pa
}
Node *GLTFDocument::generate_scene(Ref<GLTFState> state, int32_t p_bake_fps) {
+ ERR_FAIL_NULL_V(state, nullptr);
ERR_FAIL_INDEX_V(0, state->root_nodes.size(), nullptr);
GLTFNodeIndex gltf_root = state->root_nodes.write[0];
Node *gltf_root_node = state->get_scene_node(gltf_root);