Fix T70789: Using Remove Single Override breaks file loading (crash).

We only need to refine rna pointer for actual collection properties,
other arrays we handle directly the the appy callback.
This commit is contained in:
Bastien Montagne 2019-11-08 14:52:07 +01:00
parent 3b66d2ed21
commit 76be5b5bf5
Notes: blender-bot 2023-06-26 11:58:59 +02:00
Referenced by issue #70789, Using Remove Single Override breaks file loading (crash)
1 changed files with 5 additions and 2 deletions

View File

@ -890,8 +890,11 @@ static void rna_property_override_apply_ex(Main *bmain,
* Note that here, src is the local saved ID, and dst is a copy of the linked ID (since we use
* local ID as storage to apply local changes on top of a clean copy of the linked data). */
PointerRNA private_ptr_item_dst, private_ptr_item_src, private_ptr_item_storage;
if (opop->subitem_local_name != NULL || opop->subitem_reference_name != NULL ||
opop->subitem_local_index != -1 || opop->subitem_reference_index != -1) {
if ((RNA_property_type(prop_dst) == PROP_COLLECTION &&
RNA_property_type(prop_src) == PROP_COLLECTION &&
(prop_storage == NULL || RNA_property_type(prop_storage) == PROP_COLLECTION)) &&
(opop->subitem_local_name != NULL || opop->subitem_reference_name != NULL ||
opop->subitem_local_index != -1 || opop->subitem_reference_index != -1)) {
RNA_POINTER_INVALIDATE(&private_ptr_item_dst);
RNA_POINTER_INVALIDATE(&private_ptr_item_src);
RNA_POINTER_INVALIDATE(&private_ptr_item_storage);