DATAMONGO-656 - Fixed potential NPE in MongoTemplate.