Add an additional null check for event times before writing