Skip to content

Commit 77b2946

Browse files
committed
No more crashes from #31746
1 parent c0920c8 commit 77b2946

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Modules/_sqlite/connection.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ int pysqlite_connection_register_cursor(pysqlite_Connection* connection, PyObjec
260260
}
261261
PyObject* weakref;
262262

263+
if (!connection->cursors) {
264+
PyErr_SetString(pysqlite_ProgrammingError, "Could not get the cursors list.");
265+
return 0;
266+
}
267+
263268
weakref = PyWeakref_NewRef((PyObject*)cursor, NULL);
264269
if (!weakref) {
265270
goto error;

0 commit comments

Comments
 (0)