A NullPointerException can be thrown from ScalarTypeUtilDate when the date value is null.
Found and fixed by Eddie.