Fixed a crash caused by calling a null event handler

Signed-off-by: Martin Evans <martindevans@gmail.com>