From a9209f10a66c72dc677ea1e2d6ece584565ff29d Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 14 Nov 2024 16:04:19 +0100 Subject: [PATCH] Fix #130250: Modifier copy to selected crash using quick favorites The rest of this function has null checks for the modifier because it might not be part of the context and retrieved during invocation later. Pull Request: https://projects.blender.org/blender/blender/pulls/130272 --- source/blender/editors/object/object_modifier.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/object/object_modifier.cc b/source/blender/editors/object/object_modifier.cc index 0f3d0ae9433..f0e02c97c2e 100644 --- a/source/blender/editors/object/object_modifier.cc +++ b/source/blender/editors/object/object_modifier.cc @@ -2701,12 +2701,14 @@ static bool modifier_copy_to_selected_poll(bContext *C) continue; } - if (!md && BKE_object_supports_modifiers(ob)) { + if (!md) { /* Skip type check if modifier could not be found ("modifier" context variable not set). */ - found_supported_objects = true; - break; + if (BKE_object_supports_modifiers(ob)) { + found_supported_objects = true; + break; + } } - if (BKE_object_support_modifier_type_check(ob, md->type)) { + else if (BKE_object_support_modifier_type_check(ob, md->type)) { found_supported_objects = true; break; }