mirror of
https://github.com/godotengine/godot.git
synced 2025-10-30 05:01:10 +00:00
Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
parent
0f95e9f8e6
commit
a1846b27ea
177 changed files with 517 additions and 519 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue