From b0eb3b6ebdcc34b207d126376d08ffb89ef3ee42 Mon Sep 17 00:00:00 2001 From: Silc Renew Date: Tue, 13 Dec 2022 03:00:11 +0900 Subject: Add null checks to AnimationTreeEditors and _clear_editors() --- scene/animation/animation_tree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene') diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index fbc85bd5e1..b06a21dea9 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -1759,7 +1759,7 @@ void AnimationTree::_setup_animation_player() { AnimationPlayer *new_player = nullptr; if (!animation_player.is_empty()) { - new_player = Object::cast_to(get_node(animation_player)); + new_player = Object::cast_to(get_node_or_null(animation_player)); if (new_player && !new_player->is_connected("animation_list_changed", callable_mp(this, &AnimationTree::_animation_player_changed))) { new_player->connect("animation_list_changed", callable_mp(this, &AnimationTree::_animation_player_changed)); } -- cgit v1.2.3