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

@ -142,7 +142,7 @@ void ResourcePreloaderEditor::_remove_resource(const String &p_to_remove) {
void ResourcePreloaderEditor::_paste_pressed() {
Ref<Resource> r = EditorSettings::get_singleton()->get_resource_clipboard();
if (!r.is_valid()) {
if (r.is_null()) {
dialog->set_text(TTR("Resource clipboard is empty!"));
dialog->set_title(TTR("Error!"));
dialog->set_ok_button_text(TTR("Close"));
@ -261,7 +261,7 @@ Variant ResourcePreloaderEditor::get_drag_data_fw(const Point2 &p_point, Control
String name = ti->get_metadata(0);
Ref<Resource> res = preloader->get_resource(name);
if (!res.is_valid()) {
if (res.is_null()) {
return Variant();
}