diff options
author | Bastien Montagne <bastien@blender.org> | 2022-05-16 12:01:01 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-05-16 12:01:01 +0300 |
commit | 717c150eb10a614eba209ba2f51c2b78e563aecb (patch) | |
tree | 66b98e596b69dacd49d63f99f5a0c0077c8c7c47 /source/blender/makesrna | |
parent | 124aae91e226984016aa3482f849d8bbebbb3fa3 (diff) | |
parent | 2397287a51bf45f22b2008d17e8e89c2269d870a (diff) |
Merge branch 'blender-v3.2-release'
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 91bee19481c..8f7660d4015 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -5546,7 +5546,12 @@ static char *rna_idp_path(PointerRNA *ptr, if (iter->type == IDP_GROUP) { if (prop->type == PROP_POINTER) { PointerRNA child_ptr = RNA_property_pointer_get(ptr, prop); - BLI_assert(!RNA_pointer_is_null(&child_ptr)); + if (RNA_pointer_is_null(&child_ptr)) { + /* Pointer ID prop might be a 'leaf' in the IDProp group hierarchy, in which case a NULL + * value is perfectly valid. Just means it won't match the searched needle. */ + continue; + } + link.name = iter->name; link.index = -1; if ((path = rna_idp_path(&child_ptr, iter, needle, &link))) { @@ -5568,7 +5573,11 @@ static char *rna_idp_path(PointerRNA *ptr, for (j = 0; j < iter->len; j++, array++) { PointerRNA child_ptr; if (RNA_property_collection_lookup_int(ptr, prop, j, &child_ptr)) { - BLI_assert(!RNA_pointer_is_null(&child_ptr)); + if (RNA_pointer_is_null(&child_ptr)) { + /* Array item ID prop might be a 'leaf' in the IDProp group hierarchy, in which case + * a NULL value is perfectly valid. Just means it won't match the searched needle. */ + continue; + } link.index = j; if ((path = rna_idp_path(&child_ptr, array, needle, &link))) { break; |