Fix T87768: .path_resolve fails when requested property is None.

Add a version of RNA_path_resolve_full that returns true
when the path resolves to a NULL RNA pointer.
This commit is contained in:
2021-09-03 21:58:52 +10:00
parent 0950cfd9d5
commit f9ccd26b03
3 changed files with 15 additions and 1 deletions

View File

@@ -3663,7 +3663,7 @@ static PyObject *pyrna_struct_path_resolve(BPy_StructRNA *self, PyObject *args)
return NULL;
}
if (RNA_path_resolve_full(&self->ptr, path, &r_ptr, &r_prop, &index)) {
if (RNA_path_resolve_full_maybe_null(&self->ptr, path, &r_ptr, &r_prop, &index)) {
if (r_prop) {
if (index != -1) {
if (index >= RNA_property_array_length(&r_ptr, r_prop) || index < 0) {