diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2022-09-04 09:42:03 -0500 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2022-09-04 09:52:25 -0500 |
commit | 133e5d197b00fcd8f4b967d2b0c99f14effa4478 (patch) | |
tree | cedf8623fb9da7078160735cad18cc09b5668575 /modules/gltf/extensions | |
parent | e7a0a97c0bc5d86644e62d537503e3b05313a01c (diff) |
Don't try to read values from null cameras and lights in GLTF
Diffstat (limited to 'modules/gltf/extensions')
-rw-r--r-- | modules/gltf/extensions/gltf_light.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/gltf/extensions/gltf_light.cpp b/modules/gltf/extensions/gltf_light.cpp index ab5a15c671..6923c765cb 100644 --- a/modules/gltf/extensions/gltf_light.cpp +++ b/modules/gltf/extensions/gltf_light.cpp @@ -109,6 +109,7 @@ void GLTFLight::set_outer_cone_angle(float p_outer_cone_angle) { Ref<GLTFLight> GLTFLight::from_node(const Light3D *p_light) { Ref<GLTFLight> l; l.instantiate(); + ERR_FAIL_COND_V_MSG(!p_light, l, "Tried to create a GLTFLight from a Light3D node, but the given node was null."); l->color = p_light->get_color(); if (cast_to<DirectionalLight3D>(p_light)) { l->light_type = "directional"; |