Protect date comparison against nil