Properly check events so that it doesn't execute a null function pointer and crash the universe