CacheImpl#queryCaches, #queryCache, or #updateTimestampsCache are non-null only when the query cache is enabled.
I will fix this by checking if the query cache is enabled before attempting to access these fields.