From 2049c9218205e2775ea10e6a157eb55fac3f1318 Mon Sep 17 00:00:00 2001 From: ponomaryovigor Date: Mon, 11 Dec 2023 13:02:15 +0200 Subject: [PATCH 1/5] Fix flushing with null writer --- Vostok.Hercules.Consumers/StreamBinaryEventsWriter.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Vostok.Hercules.Consumers/StreamBinaryEventsWriter.cs b/Vostok.Hercules.Consumers/StreamBinaryEventsWriter.cs index 118b4b8..cf9c9eb 100644 --- a/Vostok.Hercules.Consumers/StreamBinaryEventsWriter.cs +++ b/Vostok.Hercules.Consumers/StreamBinaryEventsWriter.cs @@ -70,6 +70,9 @@ public void Put(Action buildEvent) // note (kungurtsev, 15.08.2022): do not call concurrently with Put public async Task FlushAsync() { + if (writer is null) + return; + await FlushWriter(writer); writer = ObtainEmptyWriter(); } From 23aff80e44bb6db7971803026f69cbe0ba727131 Mon Sep 17 00:00:00 2001 From: ponomaryovigor Date: Mon, 11 Dec 2023 14:14:48 +0200 Subject: [PATCH 2/5] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce7f576..c6f375b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.3 (11-12-2023): + +Add null check in `StreamBinaryEventsWriter.FlushAsync` to prevent NRE if there were no calls to `Put` + ## 2.0.2 (29-11-2022): StreamConsumer: added supports for recall RunAsync method after cancellation From f1ad7ff8a48cf17aac708740adcad7e44246070f Mon Sep 17 00:00:00 2001 From: ponomaryovigor Date: Mon, 11 Dec 2023 14:19:29 +0200 Subject: [PATCH 3/5] Bumped version to 2.0.4. --- Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj b/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj index 3f219a0..d6e74d4 100644 --- a/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj +++ b/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj @@ -7,7 +7,7 @@ Debug;Release - 2.0.3 + 2.0.4 Vostok.Hercules.Consumers From cf9124bf0d1562e4b99bbf3a7aadbfd14c72619c Mon Sep 17 00:00:00 2001 From: ponomaryovigor Date: Mon, 11 Dec 2023 14:24:26 +0200 Subject: [PATCH 4/5] Revert "Bumped version to 2.0.4." This reverts commit f1ad7ff8a48cf17aac708740adcad7e44246070f. --- Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj b/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj index d6e74d4..3f219a0 100644 --- a/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj +++ b/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj @@ -7,7 +7,7 @@ Debug;Release - 2.0.4 + 2.0.3 Vostok.Hercules.Consumers From ac4480e3213eeed1e5c395b8362e831ecfd36039 Mon Sep 17 00:00:00 2001 From: ponomaryovigor Date: Mon, 11 Dec 2023 14:32:56 +0200 Subject: [PATCH 5/5] Bumped version to 2.0.4. --- Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj b/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj index 3f219a0..d6e74d4 100644 --- a/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj +++ b/Vostok.Hercules.Consumers/Vostok.Hercules.Consumers.csproj @@ -7,7 +7,7 @@ Debug;Release - 2.0.3 + 2.0.4 Vostok.Hercules.Consumers