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

@ -867,7 +867,7 @@ void TextShaderEditor::_check_for_external_edit() {
void TextShaderEditor::_reload_shader_from_disk() {
Ref<Shader> rel_shader = ResourceLoader::load(shader->get_path(), shader->get_class(), ResourceFormatLoader::CACHE_MODE_IGNORE);
ERR_FAIL_COND(!rel_shader.is_valid());
ERR_FAIL_COND(rel_shader.is_null());
code_editor->set_block_shader_changed(true);
shader->set_code(rel_shader->get_code());
@ -878,7 +878,7 @@ void TextShaderEditor::_reload_shader_from_disk() {
void TextShaderEditor::_reload_shader_include_from_disk() {
Ref<ShaderInclude> rel_shader_include = ResourceLoader::load(shader_inc->get_path(), shader_inc->get_class(), ResourceFormatLoader::CACHE_MODE_IGNORE);
ERR_FAIL_COND(!rel_shader_include.is_valid());
ERR_FAIL_COND(rel_shader_include.is_null());
code_editor->set_block_shader_changed(true);
shader_inc->set_code(rel_shader_include->get_code());