diff options
author | Bastien Montagne <bastien@blender.org> | 2021-02-09 20:53:52 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-02-09 20:53:52 +0300 |
commit | bace031b654fec17fd23541b4b667253870e3355 (patch) | |
tree | 5dec7d4f5a56fc0a85960adf76df738884c0354d /source | |
parent | ebdaa52fa7090382b22d08086c3bb5821db815b4 (diff) |
Fix (unreported) assert in liboverride reset code.
Invalid override properties ( i.e. invalid RNA paths) are not strictly
speaking errors, many things can lead to that situation. Just ignore and
skip those cases.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 03ce1b8c9ca..68a75e469fd 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -1647,24 +1647,26 @@ static bool lib_override_library_id_reset_do(Main *bmain, ID *id_root) &ptr_root_lib); bool prop_exists = RNA_path_resolve_property(&ptr_root, op->rna_path, &ptr, &prop); - BLI_assert(prop_exists); - prop_exists = RNA_path_resolve_property(&ptr_root_lib, op->rna_path, &ptr_lib, &prop_lib); - if (prop_exists) { - BLI_assert(ELEM(RNA_property_type(prop), PROP_POINTER, PROP_COLLECTION)); - BLI_assert(RNA_property_type(prop) == RNA_property_type(prop_lib)); - if (is_collection) { - ptr.type = RNA_property_pointer_type(&ptr, prop); - ptr_lib.type = RNA_property_pointer_type(&ptr_lib, prop_lib); - } - else { - ptr = RNA_property_pointer_get(&ptr, prop); - ptr_lib = RNA_property_pointer_get(&ptr_lib, prop_lib); - } - if (ptr.owner_id != NULL && ptr_lib.owner_id != NULL) { - BLI_assert(ptr.type == ptr_lib.type); - do_op_delete = !(RNA_struct_is_ID(ptr.type) && ptr.owner_id->override_library != NULL && - ptr.owner_id->override_library->reference == ptr_lib.owner_id); + prop_exists = RNA_path_resolve_property(&ptr_root_lib, op->rna_path, &ptr_lib, &prop_lib); + + if (prop_exists) { + BLI_assert(ELEM(RNA_property_type(prop), PROP_POINTER, PROP_COLLECTION)); + BLI_assert(RNA_property_type(prop) == RNA_property_type(prop_lib)); + if (is_collection) { + ptr.type = RNA_property_pointer_type(&ptr, prop); + ptr_lib.type = RNA_property_pointer_type(&ptr_lib, prop_lib); + } + else { + ptr = RNA_property_pointer_get(&ptr, prop); + ptr_lib = RNA_property_pointer_get(&ptr_lib, prop_lib); + } + if (ptr.owner_id != NULL && ptr_lib.owner_id != NULL) { + BLI_assert(ptr.type == ptr_lib.type); + do_op_delete = !(RNA_struct_is_ID(ptr.type) && + ptr.owner_id->override_library != NULL && + ptr.owner_id->override_library->reference == ptr_lib.owner_id); + } } } } |