diff --git a/crates/project/src/debugger/breakpoint_store.rs b/crates/project/src/debugger/breakpoint_store.rs index 33cc3d30a2..5cc361a73e 100644 --- a/crates/project/src/debugger/breakpoint_store.rs +++ b/crates/project/src/debugger/breakpoint_store.rs @@ -591,7 +591,13 @@ impl BreakpointStore { this.update(cx, |_, cx| BreakpointsInFile::new(buffer, cx))?; for bp in bps { - let position = snapshot.anchor_after(PointUtf16::new(bp.row, 0)); + let max_point = snapshot.max_point_utf16(); + let point = PointUtf16::new(bp.row, 0); + if point > max_point { + log::error!("skipping a deserialized breakpoint that's out of range"); + continue; + } + let position = snapshot.anchor_after(point); breakpoints_for_file.breakpoints.push(( position, Breakpoint {