forked from mirrors/kore
coro_running could be NULL, check it.
This commit is contained in:
parent
7613a4a135
commit
6b3347ae3a
|
@ -1810,7 +1810,7 @@ python_kore_task_kill(PyObject *self, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "I", &id))
|
||||
return (NULL);
|
||||
|
||||
if (coro_running->id == id) {
|
||||
if (coro_running != NULL && coro_running->id == id) {
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"refusing to kill active coroutine");
|
||||
return (NULL);
|
||||
|
|
Loading…
Reference in New Issue