Skip to content

Commit

Permalink
Prevent _allocate_placeholders crash if p_version->variants is null
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjtxietian committed Oct 22, 2023
1 parent 8c25a98 commit 5f85a04
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions servers/rendering/renderer_rd/shader_rd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5f85a04

Please sign in to comment.