From baf0fb7e26e9aa7943f1d7e2b6e10a66cd2ecb26 Mon Sep 17 00:00:00 2001 From: Ainsley Su Date: Thu, 3 Oct 2024 10:59:36 +0200 Subject: [PATCH] Fix error when stopping empty animation player. Check if animation exists before get section start time. Signed-off-by: Ainsley Su --- scene/animation/animation_player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index bc951e4e149..8a2ca479209 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -777,7 +777,7 @@ void AnimationPlayer::_stop_internal(bool p_reset, bool p_keep_state) { _clear_caches(); Playback &c = playback; // c.blend.clear(); - double start = get_section_start_time(); + double start = c.current.from ? get_section_start_time() : 0; if (p_reset) { c.blend.clear(); if (p_keep_state) {