diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index 3bcf0e42..7a92ee24 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -658,7 +658,7 @@ _psyco_curs_prefetch(cursorObject *self) /* check if there is an asynchronous query in progess and block until data is read from it */ - if (self->conn->async_cursor) { + if (self->conn->async_cursor != NULL) { /* first check if it's the right cursor */ if (self->conn->async_cursor != (PyObject*)self) { psyco_set_error(ProgrammingError, (PyObject*)self,