aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-06-14 20:02:10 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-06-15 15:13:55 -0300
commit34c5a73107e90e874e3f392a7effb4c598882190 (patch)
tree8df1969d8fed4265e98ce4d459a0add4f0b43fdc
parent4bab9a89c8a0bd22b1a95e46cf75d9e2dd7f42e1 (diff)
Shiboken::cppObjectIsInvalid(PyObject*) now returns false when the argument is NULL.
Because NULL objects aren't invalid Python wrappers.
-rw-r--r--libshiboken/basewrapper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index 2b758d7c6..05926d17d 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -340,7 +340,7 @@ bool setCppPointer(SbkBaseWrapper* wrapper, PyTypeObject* desiredType, void* cpt
bool cppObjectIsInvalid(PyObject* wrapper)
{
- if (wrapper == Py_None
+ if (!wrapper || wrapper == Py_None
|| wrapper->ob_type->ob_type != &Shiboken::SbkBaseWrapperType_Type
|| ((Shiboken::SbkBaseWrapper*)wrapper)->validCppObject) {
return false;