fix possible seg fault when reporting bad object type

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7061 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-03-14 21:16:25 +00:00
commit 6bb35657f2

View file

@ -460,7 +460,7 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
{
if (type) {
#if defined(SWIG_COBJECT_TYPES)
if (PySwigObject_Check(obj)) {
if (obj && PySwigObject_Check(obj)) {
const char *otype = (const char *) PySwigObject_GetDesc(obj);
if (otype) {
PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",