misc/events.c: (Thanks to ileoo) Fix a crash.