Skip to content

Commit

Permalink
Merge branch 'FixNullWriter'
Browse files Browse the repository at this point in the history
  • Loading branch information
ponomaryovigor committed Dec 11, 2023
2 parents c3f040a + 4ebc13f commit bbc277c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions Vostok.Hercules.Consumers/StreamBinaryEventsWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public void Put(Action<IHerculesEventBuilder> 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();
}
Expand Down

0 comments on commit bbc277c

Please sign in to comment.