summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/storage_rd
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2022-09-30 09:55:32 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2022-09-30 10:18:14 +0800
commitffdac72eaa8691d26965b158cbe314b4dd828f06 (patch)
treec935b7dadd0108cdfef73119654e6408df5a5521 /servers/rendering/renderer_rd/storage_rd
parent56563ef09e779b9f4b105fea0e5a1a8e59c7cfe8 (diff)
Add various null checks in RenderingServer
Diffstat (limited to 'servers/rendering/renderer_rd/storage_rd')
-rw-r--r--servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp1
-rw-r--r--servers/rendering/renderer_rd/storage_rd/texture_storage.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
index 1827b73507..b089b96101 100644
--- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
@@ -2021,6 +2021,7 @@ Transform2D MeshStorage::skeleton_bone_get_transform_2d(RID p_skeleton, int p_bo
void MeshStorage::skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform) {
Skeleton *skeleton = skeleton_owner.get_or_null(p_skeleton);
+ ERR_FAIL_NULL(skeleton);
ERR_FAIL_COND(!skeleton->use_2d);
skeleton->base_transform_2d = p_base_transform;
diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
index 800a742cb6..21811068cd 100644
--- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
@@ -673,6 +673,8 @@ void TextureStorage::texture_free(RID p_texture) {
}
void TextureStorage::texture_2d_initialize(RID p_texture, const Ref<Image> &p_image) {
+ ERR_FAIL_COND(p_image.is_null());
+
TextureToRDFormat ret_format;
Ref<Image> image = _validate_texture_format(p_image, ret_format);