Improve use of Ref.is_null/valid

Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
A Thousand Ships 2024-08-25 14:15:10 +02:00 committed by AThousandShips
parent 0f95e9f8e6
commit a1846b27ea
No known key found for this signature in database
GPG key ID: DEFC5A5B1306947D
177 changed files with 517 additions and 519 deletions

View file

@ -91,12 +91,12 @@ Ref<Texture2D> EditorTexturePreviewPlugin::generate(const Ref<Resource> &p_from,
if (tex_atlas.is_valid()) {
Ref<Texture2D> tex = tex_atlas->get_atlas();
if (!tex.is_valid()) {
if (tex.is_null()) {
return Ref<Texture2D>();
}
Ref<Image> atlas = tex->get_image();
if (!atlas.is_valid()) {
if (atlas.is_null()) {
return Ref<Texture2D>();
}
@ -347,7 +347,7 @@ Ref<Texture2D> EditorMaterialPreviewPlugin::generate(const Ref<Resource> &p_from
Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
RS::get_singleton()->mesh_surface_set_material(sphere, 0, RID());
ERR_FAIL_COND_V(!img.is_valid(), Ref<ImageTexture>());
ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
img->convert(Image::FORMAT_RGBA8);
int thumbnail_size = MAX(p_size.x, p_size.y);