2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 03:11:24 +00:00

Prevent divided-by-zero for empty BytesStreams

This commit is contained in:
asonix 2024-04-05 12:21:36 -05:00
parent eca3697410
commit 4021458be8

View file

@ -35,7 +35,7 @@ impl BytesStream {
tracing::debug!(
"BytesStream with {} chunks, avg length {}",
bs.chunks_len(),
bs.len() / bs.chunks_len()
bs.len() / bs.chunks_len().max(1)
);
Ok(bs)