coro_running could be NULL, check it.

This commit is contained in:
Joris Vink 2020-08-12 13:43:38 +02:00
parent 7613a4a135
commit 6b3347ae3a
1 changed files with 1 additions and 1 deletions

View File

@ -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);