From 31a667cb0f28fe5f9f08d993403abab470c9ffe5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 09:37:34 +0100 Subject: [PATCH] Fix `RequestConfiguration` (#8426) (#8427) Co-authored-by: Florian Bernd --- .../_Shared/Core/Request/RequestDescriptor.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; }