Skip to content

Commit cc71e5d

Browse files
fix(span): Remove division that might divide by zero (#4826)
1 parent 1aac39b commit cc71e5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

relay-server/src/utils/sizes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn check_envelope_size_limits(
9090
// For item containers, we want to check that the contained items obey
9191
// the size limits *on average*.
9292
// For standalone items, this is just the item size itself.
93-
let avg_item_size = item.len() / (item.item_count().unwrap_or(1) as usize);
93+
let avg_item_size = item.len() / (item.item_count().unwrap_or(1).max(1) as usize);
9494
if avg_item_size > max_size {
9595
return Err(item
9696
.attachment_type()

0 commit comments

Comments
 (0)