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:
parent
a25fbd5159
commit
6bb35657f2
1 changed files with 1 additions and 1 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue