Skip to content

Commit

Permalink
Merge pull request #85461 from akien-mga/AnimationMixer-validate-obje…
Browse files Browse the repository at this point in the history
…ct-before-blend

AnimationMixer: Validate ObjectID before blend in case the object was freed
  • Loading branch information
akien-mga committed Nov 28, 2023
2 parents f82bf35 + a363269 commit 83ae2b1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scene/animation/animation_mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,12 @@ void AnimationMixer::_blend_apply() {
}
}
}
t->object->set_indexed(t->subpath, Animation::cast_from_blendwise(t->value, t->init_value.get_type()));

// t->object isn't safe here, get instance from id (GH-85365).
Object *obj = ObjectDB::get_instance(t->object_id);
if (obj) {
obj->set_indexed(t->subpath, Animation::cast_from_blendwise(t->value, t->init_value.get_type()));
}

} break;
case Animation::TYPE_BEZIER: {
Expand Down

0 comments on commit 83ae2b1

Please sign in to comment.