fix seg fault when runtime fails

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7060 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-03-12 01:11:49 +00:00
commit a25fbd5159

View file

@ -686,6 +686,12 @@ type_error:
SWIGRUNTIME PyObject *
SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) {
PyObject *robj = 0;
if (!type) {
if (!PyErr_Occurred()) {
PyErr_Format(PyExc_TypeError, "Swig: null type passed to NewPointerObj");
}
return robj;
}
if (!ptr) {
Py_INCREF(Py_None);
return Py_None;