Merge pull request #85428 from jsjtxietian/prevent-nullptr-crash-in-AnimationMixer--restore

Prevent a crash when calling `AnimationMixer::restore` with an invalid resource
This commit is contained in:
Rémi Verschelde 2023-12-04 23:14:29 +01:00
commit 6b21a185e2
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 0 deletions

View File

@ -1985,6 +1985,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 *>();