Skip to content

Commit

Permalink
Fix crash if buffer is empty. Crash is due to a range with the start …
Browse files Browse the repository at this point in the history
…greater than the end.
  • Loading branch information
tonystone committed Oct 8, 2020
1 parent d382cd5 commit 0623e7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/TraceLog/Internal/Proxies/AsyncWriterProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ internal class AsyncWriterProxy: WriterProxy {
/// If the writer is available, read and log all message
/// (in order) from the buffer.
///
for _ in 1...buffer.queue.count {
for _ in 0..<buffer.queue.count {
let entry = buffer.queue.peek()

switch self.writer.write(entry) {
Expand Down

0 comments on commit 0623e7a

Please sign in to comment.