Fix #153465: IDProp: Raise error when type doesn't match in update_from()

Docstring says to raise error when src/dst idprop doesn't match. Now
added an extra if check to handle that. As mentioned in the bug report,
copy lib override flag in update_from() api function.

Pull Request: https://projects.blender.org/blender/blender/pulls/153510
This commit is contained in:
Pratik Borhade 2026-01-29 09:34:24 +01:00 • committed by Pratik Borhade
parent 9c29b23fd2
commit 89de863679

View file

@ -962,12 +962,18 @@ static PyObject *BPy_IDPropertyUIManager_update_from(BPy_IDPropertyUIManager *se
return nullptr;
}
IDProperty *src_prop = ui_manager_src->property;
if ((property->type != src_prop->type) || property->subtype != src_prop->subtype) {
PyErr_SetString(PyExc_TypeError, "Properties type does not match.");
return nullptr;
}
if (property->ui_data != nullptr) {
IDP_ui_data_free(property);
}
if (ui_manager_src->property && ui_manager_src->property->ui_data) {
property->ui_data = IDP_ui_data_copy(ui_manager_src->property);
property->ui_data = IDP_ui_data_copy(src_prop);
}
Py_RETURN_NONE;