Bad check for null - related to date range check being inverted