summaryrefslogtreecommitdiffstats
path: root/modules/gltf
diff options
context:
space:
mode:
authorMatthew Newall <matthewnewall@hotmail.com>2021-09-20 01:35:00 +0000
committerMatthew Newall <matthewnewall@hotmail.com>2021-09-20 11:38:39 +0000
commitca55dfc00c315ee3f518f2f1715ef0dbf8d39573 (patch)
tree7b60aaf5d9a45c348b56ca729ae2e2b243ec7d27 /modules/gltf
parentb1063a7c02c313719fed660feba544dbcd1dac89 (diff)
downloadredot-engine-ca55dfc00c315ee3f518f2f1715ef0dbf8d39573.tar.gz
Corrected GLTFDocument::save_scene from processing a nullptr
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
Diffstat (limited to 'modules/gltf')
-rw-r--r--modules/gltf/gltf_document.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index d4f4221663..df2856ec7c 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -6744,6 +6744,8 @@ Error GLTFDocument::_serialize_file(Ref<GLTFState> state, const String p_path) {
Error GLTFDocument::save_scene(Node *p_node, const String &p_path,
const String &p_src_path, uint32_t p_flags,
float p_bake_fps, Ref<GLTFState> r_state) {
+ ERR_FAIL_NULL_V(p_node, ERR_INVALID_PARAMETER);
+
Ref<GLTFDocument> gltf_document;
gltf_document.instantiate();
if (r_state == Ref<GLTFState>()) {