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:
authorSybren A. Stüvel <sybren@blender.org>2022-02-14 13:09:34 +0300
committerSybren A. Stüvel <sybren@blender.org>2022-02-14 13:09:34 +0300
commit777953f36b58008678a2455ce484aa6b88df245d (patch)
tree111be8b01f5c97c78dd9c46ff8e1aafa1ae30fbf
parent48e2bf3638e1d96d8cbfbc74d29c347ccfcad576 (diff)
parente0fd31f083e0cd835635013a31fd3da6cf298ffa (diff)
Merge remote-tracking branch 'origin/blender-v3.1-release'
-rw-r--r--source/blender/python/generic/idprop_py_ui_api.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c
index 53af75720e5..890ba997548 100644
--- a/source/blender/python/generic/idprop_py_ui_api.c
+++ b/source/blender/python/generic/idprop_py_ui_api.c
@@ -35,6 +35,12 @@
static bool args_contain_key(PyObject *kwargs, const char *name)
{
+ if (kwargs == NULL) {
+ /* When a function gets called without any kwargs, Python just passes NULL instead.
+ * PyDict_Contains() is not NULL-safe, though. */
+ return false;
+ }
+
PyObject *py_key = PyUnicode_FromString(name);
const bool result = PyDict_Contains(kwargs, py_key) == 1;
Py_DECREF(py_key);