Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-11-02 15:59:10 +0300
committerHans Goudey <h.goudey@me.com>2021-11-02 15:59:10 +0300
commitefcf36f2e9773f30fa6d4cce8fd0e793b9694b78 (patch)
treec9e412d58d22355d28893c3a6e9dc23da32277c4
parent2f0f08bc9817ae7e7f9390fca3644454af7d72ed (diff)
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
-rw-r--r--source/blender/python/generic/idprop_py_ui_api.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c
index 7827bd48dfe..37ba27f7315 100644
--- a/source/blender/python/generic/idprop_py_ui_api.c
+++ b/source/blender/python/generic/idprop_py_ui_api.c
@@ -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;
}