diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-04-23 04:28:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-04-23 04:31:47 +0300 |
commit | c632396733ab5b9e338cb532501cc84d19cc67c2 (patch) | |
tree | cde948bb2b3f51a301cc3aac7bd5eb979fd2395e /source/blender | |
parent | a68bd94d110a187b00f530a6e9a7122ca76a52ab (diff) |
Fix T75991: crash when rigidbody encounters unknown constraint type
This just adds a check to prevent the crash,
Versioning invalid types still needed.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/rigidbody.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index f08de835a9d..4d37c2ea931 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -1027,6 +1027,11 @@ static void rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, b return; } + /* When 'rbc->type' is unknown. */ + if (rbc->physics_constraint == NULL) { + return; + } + RB_constraint_set_enabled(rbc->physics_constraint, rbc->flag & RBC_FLAG_ENABLED); if (rbc->flag & RBC_FLAG_USE_BREAKING) { |