From 5f85a042b6bd4bb6808c3aa0e626799403a0b687 Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Sun, 22 Oct 2023 22:46:00 +0800 Subject: [PATCH] Prevent `_allocate_placeholders` crash if `p_version->variants` is null --- servers/rendering/renderer_rd/shader_rd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/servers/rendering/renderer_rd/shader_rd.cpp b/servers/rendering/renderer_rd/shader_rd.cpp index 10e37c7da8b..242b0301f1f 100644 --- a/servers/rendering/renderer_rd/shader_rd.cpp +++ b/servers/rendering/renderer_rd/shader_rd.cpp @@ -480,6 +480,7 @@ void ShaderRD::_save_to_cache(Version *p_version, int p_group) { } void ShaderRD::_allocate_placeholders(Version *p_version, int p_group) { + ERR_FAIL_NULL(p_version->variants); for (uint32_t i = 0; i < group_to_variant_map[p_group].size(); i++) { int variant_id = group_to_variant_map[p_group][i]; RID shader = RD::get_singleton()->shader_create_placeholder();