diff options
author | Silc Renew <tokage.it.lab@gmail.com> | 2022-12-13 03:00:11 +0900 |
---|---|---|
committer | Silc Renew <tokage.it.lab@gmail.com> | 2022-12-13 03:06:51 +0900 |
commit | b0eb3b6ebdcc34b207d126376d08ffb89ef3ee42 (patch) | |
tree | c859f6ca29c955e182a0784199138576eb3541ec /scene/animation | |
parent | bc5d67c61345758741fe087c6b5282402b0b2465 (diff) |
Add null checks to AnimationTreeEditors and _clear_editors()
Diffstat (limited to 'scene/animation')
-rw-r--r-- | scene/animation/animation_tree.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<AnimationPlayer>(get_node(animation_player)); + new_player = Object::cast_to<AnimationPlayer>(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)); } |