Fix T80596: Convert to Curve from Mesh crashes Blender

The point cache code needs a non NULL rbw pointer.

This could have been avoided if there was a sanity check in the convert
function, so added a check there as well.
This commit is contained in:
2020-09-09 11:46:40 +02:00
parent 377a1e3d7b
commit d51c8f78ff
3 changed files with 11 additions and 9 deletions

View File

@@ -2572,7 +2572,9 @@ static int object_convert_exec(bContext *C, wmOperator *op)
if (newob->type == OB_CURVE) {
BKE_object_free_modifiers(newob, 0); /* after derivedmesh calls! */
ED_rigidbody_object_remove(bmain, scene, newob);
if (newob->rigidbody_object != NULL) {
ED_rigidbody_object_remove(bmain, scene, newob);
}
}
}
else if (ob->type == OB_MESH && target == OB_GPENCIL) {