Fix crash removing objects rigid body constraints

This commit is contained in:
Campbell Barton 2014-05-12 14:55:54 +10:00
parent d1526da787
commit e2672a433b
Notes: blender-bot 2023-02-14 10:40:09 +01:00
Referenced by issue #40129, Script using text view crashes Blender
1 changed files with 1 additions and 4 deletions

View File

@ -935,10 +935,7 @@ void BKE_rigidbody_remove_object(Scene *scene, Object *ob)
Object *obt = go->ob;
if (obt && obt->rigidbody_constraint) {
rbc = obt->rigidbody_constraint;
if (rbc->ob1 == ob) {
BKE_rigidbody_remove_constraint(scene, obt);
}
if (rbc->ob2 == ob) {
if (ELEM(ob, rbc->ob1, rbc->ob2)) {
BKE_rigidbody_remove_constraint(scene, obt);
}
}