You've already forked godot
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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user