Skip to content

Commit

Permalink
Fix flushing with null writer
Browse files Browse the repository at this point in the history
  • Loading branch information
ponomaryovigor committed Dec 11, 2023
1 parent c3f040a commit 454a9a0
Showing 1 changed file with 3 additions and 0 deletions.
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 454a9a0

Please sign in to comment.