aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/shiboken2/libshiboken/basewrapper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp
index 3e1a7e8e5..8fe4710dd 100644
--- a/sources/shiboken2/libshiboken/basewrapper.cpp
+++ b/sources/shiboken2/libshiboken/basewrapper.cpp
@@ -844,6 +844,10 @@ static void setSequenceOwnership(PyObject* pyObj, bool owner)
{
bool has_length = true;
+
+ if (!pyObj)
+ return;
+
if (PySequence_Size(pyObj) < 0) {
PyErr_Clear();
has_length = false;