Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Add null check for root_animation_node in AnimationTree

Silc Lizard (Tokage) Renewc3b215de9625
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index 16aac0f9d11..b86b58afcec 100644
--- a/scene/animation/animation_tree.cpp
+++ b/scene/animation/animation_tree.cpp
@@ -660,6 +660,11 @@ Ref<AnimationRootNode> AnimationTree::get_root_animation_node() const {
bool AnimationTree::_blend_pre_process(double p_delta, int p_track_count, const AHashMap<NodePath, int> &p_track_map) {
_update_properties(); // If properties need updating, update them.
+ if (root_animation_node.is_null()) {
+ process_state = AnimationNode::ProcessState();
+ return false; // Abort after _update_properties() and init process_state.
+ }
+
if (validation_dirty) {
_update_connections();
validation_dirty = false;