diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2022-02-14 13:09:34 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-02-14 13:09:34 +0300 |
commit | 777953f36b58008678a2455ce484aa6b88df245d (patch) | |
tree | 111be8b01f5c97c78dd9c46ff8e1aafa1ae30fbf /source/blender/python | |
parent | 48e2bf3638e1d96d8cbfbc74d29c347ccfcad576 (diff) | |
parent | e0fd31f083e0cd835635013a31fd3da6cf298ffa (diff) |
Merge remote-tracking branch 'origin/blender-v3.1-release'
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/generic/idprop_py_ui_api.c | 6 |
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); |