浏览代码

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

Prevent a crash when calling `AnimationMixer::restore` with an invalid resource
Rémi Verschelde 1 年之前
父节点
当前提交
6b21a185e2
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      scene/animation/animation_mixer.cpp

+ 1 - 0
scene/animation/animation_mixer.cpp

@@ -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 *>();