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:
1 parent
97a8fe7828
commit
a8043dcff8
1 file changed
+4
@@ -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