Skip to content

Commit

Permalink
chore: catch overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed Oct 10, 2023
1 parent a160a2c commit 91c497f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/jwst-codec/src/doc/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,9 @@ impl DocStore {
// 3. adjust parent length
if item.parent_sub.is_none() && item.countable() {
if let Some(parent) = parent {
parent.len -= item.len();
if parent.len != 0 {
parent.len -= item.len();
}
} else if let Some(Parent::Type(ty)) = &item.parent {
ty.ty_mut().unwrap().len -= item.len();
}
Expand Down

1 comment on commit 91c497f

@vercel
Copy link

@vercel vercel bot commented on 91c497f Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.