diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-13 10:09:48 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-13 10:09:48 +0100 |
commit | 6f8f6b3c9e1748767a9447f869d66e5f139f5c3d (patch) | |
tree | 352507e0ff114a92e073b736c60657d4cd7e2fe4 /scene | |
parent | 4828ac6b9931ee2ea606cf47c68604b1a2b2d3ed (diff) | |
parent | b0eb3b6ebdcc34b207d126376d08ffb89ef3ee42 (diff) |
Merge pull request #69973 from TokageItLab/null-check-animtree-edit
Add null checks to AnimationTreeEditors and `_clear_editors()` to `_node_removed()`
Diffstat (limited to 'scene')
-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)); } |