diff --git a/src/main/exception.c b/src/main/exception.c index d1dcd5ec7..4f9a7ab0d 100644 --- a/src/main/exception.c +++ b/src/main/exception.c @@ -321,6 +321,7 @@ PyObject *AerospikeException_New(void) PyObject *py_code = NULL; if (exception_def.code == NO_ERROR_CODE) { + Py_INCREF(Py_None); py_code = Py_None; } else {