Add null check for updateEvent