Fix T92532: Missing null checks in IDPropertyManager.update_from

Calling it with a None argument, or no arguments, or with a property
that is missing UI data for some reason would fail. There is no
particular reason why ensuring those things don't happen is helpful,
so just add null checks for safety.

Differential Revision: https://developer.blender.org/D13024
This commit is contained in:
Hans Goudey 2021-11-02 07:59:10 -05:00
parent 2f0f08bc98
commit efcf36f2e9
Notes: blender-bot 2023-02-14 11:07:28 +01:00
Referenced by issue #92532, Python: calling id_properties_ui(key).update() without arguments, crashes blender
1 changed files with 3 additions and 1 deletions

View File

@ -622,7 +622,9 @@ static PyObject *BPy_IDPropertyUIManager_update_from(BPy_IDPropertyUIManager *se
IDP_ui_data_free(property);
}
property->ui_data = IDP_ui_data_copy(ui_manager_src->property);
if (ui_manager_src->property && ui_manager_src->property->ui_data) {
property->ui_data = IDP_ui_data_copy(ui_manager_src->property);
}
Py_RETURN_NONE;
}