[Servers] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable

This commit is contained in:
A Thousand Ships
2023-09-09 17:04:18 +02:00
parent 82f6e9be5e
commit fdd3d36c6d
48 changed files with 1105 additions and 1105 deletions
@@ -73,21 +73,21 @@ public:
virtual RID texture_allocate() override {
DummyTexture *texture = memnew(DummyTexture);
ERR_FAIL_COND_V(!texture, RID());
ERR_FAIL_NULL_V(texture, RID());
return texture_owner.make_rid(texture);
};
virtual void texture_free(RID p_rid) override {
// delete the texture
DummyTexture *texture = texture_owner.get_or_null(p_rid);
ERR_FAIL_COND(!texture);
ERR_FAIL_NULL(texture);
texture_owner.free(p_rid);
memdelete(texture);
};
virtual void texture_2d_initialize(RID p_texture, const Ref<Image> &p_image) override {
DummyTexture *t = texture_owner.get_or_null(p_texture);
ERR_FAIL_COND(!t);
ERR_FAIL_NULL(t);
t->image = p_image->duplicate();
};
virtual void texture_2d_layered_initialize(RID p_texture, const Vector<Ref<Image>> &p_layers, RS::TextureLayeredType p_layered_type) override{};
@@ -105,7 +105,7 @@ public:
virtual Ref<Image> texture_2d_get(RID p_texture) const override {
DummyTexture *t = texture_owner.get_or_null(p_texture);
ERR_FAIL_COND_V(!t, Ref<Image>());
ERR_FAIL_NULL_V(t, Ref<Image>());
return t->image;
};
virtual Ref<Image> texture_2d_layer_get(RID p_texture, int p_layer) const override { return Ref<Image>(); };