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

@ -4375,7 +4375,7 @@ void CanvasItemEditor::_insert_animation_keys(bool p_location, bool p_rotation,
const HashMap<Node *, Object *> &selection = editor_selection->get_selection();
AnimationTrackEditor *te = AnimationPlayerEditor::get_singleton()->get_track_editor();
ERR_FAIL_COND_MSG(!te->get_current_animation().is_valid(), "Cannot insert animation key. No animation selected.");
ERR_FAIL_COND_MSG(te->get_current_animation().is_null(), "Cannot insert animation key. No animation selected.");
te->make_insert_queue();
for (const KeyValue<Node *, Object *> &E : selection) {
@ -6007,7 +6007,7 @@ void CanvasItemEditorViewport::_create_audio_node(Node *p_parent, const String &
bool CanvasItemEditorViewport::_create_instance(Node *p_parent, const String &p_path, const Point2 &p_point) {
Ref<PackedScene> sdata = ResourceLoader::load(p_path);
if (!sdata.is_valid()) { // invalid scene
if (sdata.is_null()) { // invalid scene
return false;
}