Prevent a crash when calling AnimationMixer::restore when an invalid reference

This commit is contained in:
jsjtxietian 2023-11-28 12:54:06 +08:00
parent 5df9867967
commit 937411e152
1 changed files with 1 additions and 0 deletions

View File

@ -1980,6 +1980,7 @@ void AnimationMixer::reset() {
}
void AnimationMixer::restore(const Ref<AnimatedValuesBackup> &p_backup) {
ERR_FAIL_COND(p_backup.is_null());
track_cache = p_backup->get_data();
_blend_apply();
track_cache = HashMap<NodePath, AnimationMixer::TrackCache *>();