diff --git a/src/Elastic.Clients.Elasticsearch/_Shared/Core/Request/RequestDescriptor.cs b/src/Elastic.Clients.Elasticsearch/_Shared/Core/Request/RequestDescriptor.cs index 05723aa785..157552162a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Shared/Core/Request/RequestDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch/_Shared/Core/Request/RequestDescriptor.cs @@ -59,8 +59,9 @@ protected TDescriptor Qs(string name, IStringable value) /// public TDescriptor RequestConfiguration(Func configurationSelector) { - var rc = RequestConfig; - RequestConfig = configurationSelector?.Invoke(new RequestConfigurationDescriptor(rc)) ?? rc; + RequestConfig = configurationSelector?.Invoke(RequestConfig is null + ? new RequestConfigurationDescriptor() + : new RequestConfigurationDescriptor(RequestConfig)) ?? RequestConfig; return _descriptor; }