diff options
author | mightygoat <alpha5and5official@gmail.com> | 2022-05-05 12:25:02 +0530 |
---|---|---|
committer | mightygoat <alpha5and5official@gmail.com> | 2022-05-05 12:25:02 +0530 |
commit | 61df370810c4e8cce00c69edfab1d61036352cfa (patch) | |
tree | a21f3030368151d1f78665919c70e976a8e9dafb | |
parent | 10209e31eb65c6bdf08edf47ff7c197b42f352d8 (diff) |
Check multimesh before uniform set creation
-rw-r--r-- | servers/rendering/renderer_rd/storage_rd/mesh_storage.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h index 023d38406c..7d3f603afd 100644 --- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h @@ -614,6 +614,9 @@ public: _FORCE_INLINE_ RID multimesh_get_3d_uniform_set(RID p_multimesh, RID p_shader, uint32_t p_set) const { MultiMesh *multimesh = multimesh_owner.get_or_null(p_multimesh); + if (multimesh == nullptr) { + return RID(); + } if (!multimesh->uniform_set_3d.is_valid()) { if (!multimesh->buffer.is_valid()) { return RID(); @@ -632,6 +635,9 @@ public: _FORCE_INLINE_ RID multimesh_get_2d_uniform_set(RID p_multimesh, RID p_shader, uint32_t p_set) const { MultiMesh *multimesh = multimesh_owner.get_or_null(p_multimesh); + if (multimesh == nullptr) { + return RID(); + } if (!multimesh->uniform_set_2d.is_valid()) { if (!multimesh->buffer.is_valid()) { return RID(); |