1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +00:00

Add null checks to AnimationTreeEditors and _clear_editors()

This commit is contained in:
Silc Renew
2022-12-13 03:00:11 +09:00
parent bc5d67c613
commit b0eb3b6ebd
7 changed files with 138 additions and 57 deletions

View File

@@ -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));
}