Skip to content

Commit

Permalink
fix: added check for number of total bytes to write
Browse files Browse the repository at this point in the history
  • Loading branch information
novoj committed Feb 6, 2025
1 parent 1098d6e commit f66c596
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,10 @@ private void writeDataToFileChannel(@Nonnull ByteBuffer memoryByteBuffer, int to
* used to adjust the position of the ring buffer tail.
*/
private void updateSessionLocations(int totalBytesToWrite) throws IOException {
if (totalBytesToWrite == 0) {
// no bytes to write, nothing to update
return;
}
final long newTail = this.ringBufferTail + totalBytesToWrite;
SessionLocation head = this.sessionLocations.peekFirst();
while (head != null) {
Expand Down

0 comments on commit f66c596

Please sign in to comment.