From ca55dfc00c315ee3f518f2f1715ef0dbf8d39573 Mon Sep 17 00:00:00 2001 From: Matthew Newall Date: Mon, 20 Sep 2021 01:35:00 +0000 Subject: [PATCH] Corrected GLTFDocument::save_scene from processing a nullptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RĂ©mi Verschelde --- modules/gltf/gltf_document.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index d4f42216631..df2856ec7cc 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -6744,6 +6744,8 @@ Error GLTFDocument::_serialize_file(Ref 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 r_state) { + ERR_FAIL_NULL_V(p_node, ERR_INVALID_PARAMETER); + Ref gltf_document; gltf_document.instantiate(); if (r_state == Ref()) {