diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-14 19:18:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-14 19:18:20 +0200 |
commit | ec323f0ef435534c152de4ab83efb09813f1d7ae (patch) | |
tree | e8d58b632070ea7f39025b5faeb48817ef0b866e | |
parent | aa43b5a3f47c943499d6d586491ef20ec5c81359 (diff) | |
parent | fa907ce82959d42e5e4b69f5f0443742f56552cb (diff) |
Merge pull request #49584 from timothyqiu/shader-data-null-check
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 9b08da4c9e..64be54115f 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()); + } } } |