summaryrefslogtreecommitdiffstats
path: root/libshiboken/conversions.h
diff options
context:
space:
mode:
Diffstat (limited to 'libshiboken/conversions.h')
-rw-r--r--libshiboken/conversions.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h
index 13e711d8..541e026b 100644
--- a/libshiboken/conversions.h
+++ b/libshiboken/conversions.h
@@ -150,7 +150,9 @@ struct Converter<T*>
static T* toCpp(PyObject* pyobj)
{
- if (Shiboken_TypeCheck(pyobj, T))
+ if (pyobj == Py_None)
+ return 0;
+ else if (Shiboken_TypeCheck(pyobj, T))
return (T*) SbkBaseWrapper_cptr(pyobj);
else if (Converter<T>::isConvertible(pyobj))
return CppObjectCopier<T>::copy(Converter<T>::toCpp(pyobj));