Fix #116854: context.property access crashes when properties have no ID

Missing checks in [0] which didn't account for UI properties without an
ID or failure to create the property path.

[0]: 6ba0346797
This commit is contained in:
Campbell Barton
2024-01-10 13:42:17 +11:00
parent 60e74d1ef7
commit 15843b46ab

View File

@@ -4422,11 +4422,12 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
break;
}
case CTX_DATA_TYPE_PROPERTY: {
if (newprop != nullptr) {
char *path_str = nullptr;
if ((newprop != nullptr) && (newptr.owner_id != nullptr) &&
(path_str = RNA_path_from_ID_to_property(&newptr, newprop)))
{
/* Create pointer to parent ID, and path from ID to property. */
PointerRNA idptr = RNA_id_pointer_create(newptr.owner_id);
char *path_str = RNA_path_from_ID_to_property(&newptr, newprop);
ret = PyTuple_New(3);
PyTuple_SET_ITEMS(ret,
pyrna_struct_CreatePyObject(&idptr),