MODE-2095 Fixed NPE when executing date range queries.