diff --git a/source/blender/python/generic/idprop_py_ui_api.cc b/source/blender/python/generic/idprop_py_ui_api.cc index 8f873ef9572..c04fa040c3e 100644 --- a/source/blender/python/generic/idprop_py_ui_api.cc +++ b/source/blender/python/generic/idprop_py_ui_api.cc @@ -644,7 +644,11 @@ static void idprop_ui_data_to_dict_id(IDProperty *property, PyObject *dict) } const char *id_type = nullptr; - RNA_enum_identifier(rna_enum_id_type_items, id_type_value, &id_type); + if (!RNA_enum_identifier(rna_enum_id_type_items, id_type_value, &id_type)) { + /* Same fall-back as above, in case it is an unknown ID type (from a future version of Blender + * e.g.). */ + RNA_enum_identifier(rna_enum_id_type_items, ID_OB, &id_type); + } PyObject *item = PyUnicode_FromString(id_type); PyDict_SetItemString(dict, "id_type", item); Py_DECREF(item);