From 8c6890f6b3a0caba7bc325611e85701d84044dad Mon Sep 17 00:00:00 2001 From: David Leek Date: Tue, 10 Dec 2024 13:16:28 +0100 Subject: [PATCH] fix: send default buckets instead of null metrics buckets as they cause 400s --- src/Unleash/Communication/UnleashApiClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Unleash/Communication/UnleashApiClient.cs b/src/Unleash/Communication/UnleashApiClient.cs index c64ee3b..fd291d3 100644 --- a/src/Unleash/Communication/UnleashApiClient.cs +++ b/src/Unleash/Communication/UnleashApiClient.cs @@ -223,7 +223,7 @@ public async Task SendMetrics(Yggdrasil.MetricsBucket metrics, Cancellatio { AppName = clientRequestHeaders.AppName, InstanceId = clientRequestHeaders.InstanceTag, - Bucket = metrics + Bucket = metrics ?? new Yggdrasil.MetricsBucket(new Dictionary(), DateTimeOffset.UtcNow, DateTimeOffset.UtcNow) }; using (var request = new HttpRequestMessage(HttpMethod.Post, requestUri))