From f0f24b9a62a223f363c610d7f6676e8f2b92f247 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sun, 4 Sep 2022 20:43:25 +0800 Subject: [PATCH] Fix crash when executing `LightmapGIData._set_light_textures_data` --- scene/3d/lightmap_gi.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp index 32c112d21fd..b0bccc45712 100644 --- a/scene/3d/lightmap_gi.cpp +++ b/scene/3d/lightmap_gi.cpp @@ -105,6 +105,7 @@ void LightmapGIData::_set_light_textures_data(const Array &p_data) { Vector> images; for (int i = 0; i < p_data.size(); i++) { Ref texture = p_data[i]; + ERR_FAIL_COND_MSG(texture.is_null(), vformat("Invalid TextureLayered at index %d.", i)); for (int j = 0; j < texture->get_layers(); j++) { images.push_back(texture->get_layer_data(j)); }