mirror of
https://github.com/godotengine/godot.git
synced 2025-10-25 10:44:26 +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
|
|
@ -105,7 +105,7 @@ void AnimationLibraryEditor::_add_library_confirm() {
|
|||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
|
||||
Ref<AnimationLibrary> al = mixer->get_animation_library(adding_animation_to_library);
|
||||
ERR_FAIL_COND(!al.is_valid());
|
||||
ERR_FAIL_COND(al.is_null());
|
||||
|
||||
Ref<Animation> anim;
|
||||
anim.instantiate();
|
||||
|
|
@ -562,7 +562,7 @@ void AnimationLibraryEditor::_button_pressed(TreeItem *p_item, int p_column, int
|
|||
} break;
|
||||
case LIB_BUTTON_PASTE: {
|
||||
Ref<Animation> anim = EditorSettings::get_singleton()->get_resource_clipboard();
|
||||
if (!anim.is_valid()) {
|
||||
if (anim.is_null()) {
|
||||
error_dialog->set_text(TTR("No animation resource in clipboard!"));
|
||||
error_dialog->popup_centered();
|
||||
return;
|
||||
|
|
@ -628,7 +628,7 @@ void AnimationLibraryEditor::_button_pressed(TreeItem *p_item, int p_column, int
|
|||
StringName anim_name = p_item->get_metadata(0);
|
||||
Ref<AnimationLibrary> al = mixer->get_animation_library(lib_name);
|
||||
Ref<Animation> anim = al->get_animation(anim_name);
|
||||
ERR_FAIL_COND(!anim.is_valid());
|
||||
ERR_FAIL_COND(anim.is_null());
|
||||
switch (p_id) {
|
||||
case ANIM_BUTTON_COPY: {
|
||||
if (anim->get_name() == "") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue