From 047cad85d2c0a42e3e73cb4bf7f27ce719f9e52f Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:02:51 +0000 Subject: [PATCH] editor: Prevent panic when attempting to resolve a breakpoint anchor against the wrong buffer (#49893) (cherry-pick to preview) (#50005) Cherry-pick of #49893 to preview ---- Closes ZED-4HY Release Notes: - Fixed a crash when using breakpoints. Co-authored-by: Cole Miller --- crates/project/src/debugger/breakpoint_store.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/project/src/debugger/breakpoint_store.rs b/crates/project/src/debugger/breakpoint_store.rs index d548781891598b229c430692bee36919bf7669fb..54f884aa5704bd256620f35eb0ea73dc53feeab5 100644 --- a/crates/project/src/debugger/breakpoint_store.rs +++ b/crates/project/src/debugger/breakpoint_store.rs @@ -628,6 +628,10 @@ impl BreakpointStore { file_breakpoints.breakpoints.iter().filter_map({ let range = range.clone(); move |bp| { + if !buffer_snapshot.can_resolve(bp.position()) { + return None; + } + if let Some(range) = &range && (bp.position().cmp(&range.start, buffer_snapshot).is_lt() || bp.position().cmp(&range.end, buffer_snapshot).is_gt())