diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 640b70f0ff5..0b853b5b48b 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -2493,8 +2493,10 @@ Tkapp_CreateTimerHandler(PyObject *self, PyObject *args) } v = Tktt_New(func); - v->token = Tcl_CreateTimerHandler(milliseconds, TimerHandler, - (ClientData)v); + if (v) { + v->token = Tcl_CreateTimerHandler(milliseconds, TimerHandler, + (ClientData)v); + } return (PyObject *) v; }