mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-02 13:30:26 +01:00
editor: Prevent panic when attempting to resolve a breakpoint anchor against the wrong buffer (#49893)
Closes ZED-4HY Release Notes: - Fixed a crash when using breakpoints.
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user