Added check for null context being supplied to repository.