From 94079ffc7f0e49c9eb923eb59b065973ae9cd990 Mon Sep 17 00:00:00 2001 From: Howard Trickey Date: Wed, 31 Mar 2021 09:35:40 -0400 Subject: Fix T86879 Boolean exact crash with dependency loop. When boolean's Object also has a modifier that depends back on the target Object, a crash occurred. In a case like this, BKE_modifier_get_evaluated_mesh_from_evaluated_object returns NULL, so just have to protect against that case. --- source/blender/modifiers/intern/MOD_boolean.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender') diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c index fae8ac72108..ffb40bea9ba 100644 --- a/source/blender/modifiers/intern/MOD_boolean.c +++ b/source/blender/modifiers/intern/MOD_boolean.c @@ -660,6 +660,9 @@ static Mesh *exact_boolean_mesh(BooleanModifierData *bmd, BLI_array_append(material_remaps, NULL); if (bmd->flag & eBooleanModifierFlag_Object) { mesh_operand = BKE_modifier_get_evaluated_mesh_from_evaluated_object(bmd->object, false); + if (!mesh_operand) { + return mesh; + } BKE_mesh_wrapper_ensure_mdata(mesh_operand); BLI_array_append(meshes, mesh_operand); BLI_array_append(obmats, &bmd->object->obmat); @@ -673,6 +676,9 @@ static Mesh *exact_boolean_mesh(BooleanModifierData *bmd, FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (collection, ob) { if (ob->type == OB_MESH && ob != ctx->object) { Mesh *collection_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob, false); + if (!collection_mesh) { + continue; + } BKE_mesh_wrapper_ensure_mdata(collection_mesh); BLI_array_append(meshes, collection_mesh); BLI_array_append(obmats, &ob->obmat); -- cgit v1.2.3