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:
-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);