diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-06-14 13:00:35 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-06-14 13:00:35 +0800 |
commit | fa907ce82959d42e5e4b69f5f0443742f56552cb (patch) | |
tree | 50ab56a030c457666c2c9b6f8eb5894073fbe1a6 | |
parent | 12e0f10c74e9619262f1edcfdc1840432ada0565 (diff) |
Add missing null check for ShaderData
-rw-r--r-- | servers/rendering/renderer_rd/renderer_storage_rd.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index eeca283c13..3efdc39619 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -1440,8 +1440,10 @@ void RendererStorageRD::shader_set_code(RID p_shader, const String &p_code) { material->shader_type = new_type; } - for (Map<StringName, RID>::Element *E = shader->default_texture_parameter.front(); E; E = E->next()) { - shader->data->set_default_texture_param(E->key(), E->get()); + if (shader->data) { + for (Map<StringName, RID>::Element *E = shader->default_texture_parameter.front(); E; E = E->next()) { + shader->data->set_default_texture_param(E->key(), E->get()); + } } } |