From b02ebf8e438bba9dcd112f8ae8002ff5e822ea2b Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 13 Aug 2025 11:07:33 +0200 Subject: [PATCH] Fix #144373: Removing and then redefining an override property causes a crash. Code needs to ensure it gets an override property operation here, not only search for an existing one. Mistake has been there probably for years... --- source/blender/makesrna/intern/rna_rna.cc | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/source/blender/makesrna/intern/rna_rna.cc b/source/blender/makesrna/intern/rna_rna.cc index 46606bdcd78..9c3377cccb1 100644 --- a/source/blender/makesrna/intern/rna_rna.cc +++ b/source/blender/makesrna/intern/rna_rna.cc @@ -1649,16 +1649,24 @@ static void rna_property_override_diff_propptr(Main *bmain, if (opop == nullptr) { const char *subitem_refname = rna_itemname_b ? rna_itemname_b->c_str() : nullptr; const char *subitem_locname = rna_itemname_a ? rna_itemname_a->c_str() : nullptr; - opop = BKE_lib_override_library_property_operation_find(op, - subitem_refname, - subitem_locname, - ptrdiff_ctx.rna_itemid_b, - ptrdiff_ctx.rna_itemid_a, - rna_itemindex_b, - rna_itemindex_a, - true, - nullptr); + opop = BKE_lib_override_library_property_operation_get(op, + LIBOVERRIDE_OP_REPLACE, + subitem_refname, + subitem_locname, + ptrdiff_ctx.rna_itemid_b, + ptrdiff_ctx.rna_itemid_a, + rna_itemindex_b, + rna_itemindex_a, + true, + nullptr, + &created); + /* Do not use BKE_lib_override_library_operations_tag here, we do not want to + * validate as used all of its operations. */ + op->tag &= ~LIBOVERRIDE_PROP_OP_TAG_UNUSED; opop->tag &= ~LIBOVERRIDE_PROP_OP_TAG_UNUSED; + if (created) { + ptrdiff_ctx.rnadiff_ctx.report_flag |= RNA_OVERRIDE_MATCH_RESULT_CREATED; + } } BLI_assert(propptr_a->data == propptr_a->owner_id);