Fix for #3410

Avoids fatal error when trying to save null datetime value