diff --git a/apps/ivr/IvrDialogBase.cpp b/apps/ivr/IvrDialogBase.cpp index e7b2d77d..ad715a9e 100644 --- a/apps/ivr/IvrDialogBase.cpp +++ b/apps/ivr/IvrDialogBase.cpp @@ -36,7 +36,7 @@ static PyObject* IvrDialogBase_new(PyTypeObject *type, PyObject *args, PyObject return NULL; } - if (!PyCObject_Check(o_dlg)){ + if ((NULL == o_dlg) || !PyCObject_Check(o_dlg)){ Py_DECREF(self); return NULL; diff --git a/apps/ivr/IvrSipDialog.cpp b/apps/ivr/IvrSipDialog.cpp index 59093099..5485cd4d 100644 --- a/apps/ivr/IvrSipDialog.cpp +++ b/apps/ivr/IvrSipDialog.cpp @@ -26,7 +26,7 @@ static PyObject* IvrSipDialog_new(PyTypeObject *type, PyObject *args, PyObject * return NULL; } - if (!PyCObject_Check(o_dlg)){ + if ((NULL == o_dlg) || !PyCObject_Check(o_dlg)){ Py_DECREF(self); return NULL; diff --git a/apps/ivr/IvrSipReply.cpp b/apps/ivr/IvrSipReply.cpp index 0b60be20..684ec0a7 100644 --- a/apps/ivr/IvrSipReply.cpp +++ b/apps/ivr/IvrSipReply.cpp @@ -48,7 +48,7 @@ static PyObject* IvrSipReply_new(PyTypeObject *type, PyObject *args, PyObject *k return NULL; } - if (!PyCObject_Check(o_req)){ + if ((NULL == o_req) || !PyCObject_Check(o_req)){ Py_DECREF(self); return NULL; diff --git a/apps/ivr/IvrSipRequest.cpp b/apps/ivr/IvrSipRequest.cpp index dc724554..03da2fe0 100644 --- a/apps/ivr/IvrSipRequest.cpp +++ b/apps/ivr/IvrSipRequest.cpp @@ -49,7 +49,7 @@ static PyObject* IvrSipRequest_new(PyTypeObject *type, PyObject *args, PyObject return NULL; } - if (!PyCObject_Check(o_req)){ + if ((NULL == o_req) || !PyCObject_Check(o_req)){ Py_DECREF(self); return NULL;