Skip to content

Commit

Permalink
web/core: fix assertion in BoundaryPoint constructor
Browse files Browse the repository at this point in the history
Was the wrong way around
  • Loading branch information
simonwuelker committed Sep 16, 2023
1 parent ae0874d commit 8c14628
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/core/src/dom/boundary_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ impl BoundaryPoint {
#[inline]
#[must_use]
pub fn new(node: DOMPtr<dom_objects::Node>, offset: usize) -> Self {
assert!(dom_objects::Node::len(node.clone()) < offset);
let length = dom_objects::Node::len(node.clone());
assert!(offset < length);

Self { node, offset }
}
Expand Down

0 comments on commit 8c14628

Please sign in to comment.