guard against null when parsing dates