Better handling for null value passed to setTime.