mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
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:
parent
9c29b23fd2
commit
89de863679
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue