Skip to content

Commit c0920c8

Browse files
committed
The first example code doesn't crash anymore.
1 parent 9955edf commit c0920c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Modules/_sqlite/connection.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ static PyObject *
289289
pysqlite_connection_cursor_impl(pysqlite_Connection *self, PyObject *factory)
290290
/*[clinic end generated code: output=562432a9e6af2aa1 input=4127345aa091b650]*/
291291
{
292+
if (self == NULL) {
293+
return NULL;
294+
}
295+
296+
static char *kwlist[] = {"factory", NULL};
297+
PyObject* factory = NULL;
292298
PyObject* cursor;
293299

294300
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {

0 commit comments

Comments
 (0)