Skip to content

Commit ddc28ac

Browse files
committed
fix #3585 VoidResponse should not be shared #3588
1 parent a94947e commit ddc28ac

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/Elasticsearch.Net/Transport/Pipeline/ResponseBuilder.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public class ResponseBuilder<TReturn>
1313
{
1414
private const int BufferSize = 81920;
1515
private static readonly IDisposable EmptyDisposable = new MemoryStream();
16-
private static readonly VoidResponse Void = new VoidResponse();
1716
private readonly CancellationToken _cancellationToken;
1817
private readonly bool _disableDirectStreaming;
1918

@@ -187,7 +186,7 @@ private bool SetSpecialTypes(Stream responseStream, ElasticsearchResponse<TRetur
187186
private void SetVoidResult(ElasticsearchResponse<VoidResponse> result, Stream response)
188187
{
189188
response.Dispose();
190-
result.Body = Void;
189+
result.Body = new VoidResponse();
191190
}
192191
}
193192
}

src/Nest/Aggregations/Pipeline/MovingAverage/MovingAverageAggregationJsonConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
8484
private T GetOrDefault<T>(string key, Dictionary<string, JToken> properties)
8585
{
8686
if (!properties.TryGetValue(key, out JToken value)) return default(T);
87-
#if DOTNETCORE
87+
#if DOTNETCORER
8888
return value.ToObject<T>();
8989
#else
9090
return (T)Convert.ChangeType(value, typeof(T));

0 commit comments

Comments
 (0)