Fix double read panic in nav history (#22754)
This one seems to be triggered when the assistant's `View<ContextEditor>` is leased during the call into `NavHistory::for_each_entry`, which then tries to read it again through the `ItemHandle` interface. Fix it by skipping entries that can't be read in the history iteration. Release Notes: - N/A
This commit is contained in:
parent
ef583e6b5a
commit
1d8bd151b7
4 changed files with 25 additions and 4 deletions
|
@ -2975,13 +2975,15 @@ impl Workspace {
|
|||
match target {
|
||||
Some(ActivateInDirectionTarget::Pane(pane)) => cx.focus_view(&pane),
|
||||
Some(ActivateInDirectionTarget::Dock(dock)) => {
|
||||
dock.update(cx, |dock, cx| {
|
||||
// Defer this to avoid a panic when the dock's active panel is already on the stack.
|
||||
cx.defer(move |cx| {
|
||||
let dock = dock.read(cx);
|
||||
if let Some(panel) = dock.active_panel() {
|
||||
panel.focus_handle(cx).focus(cx);
|
||||
} else {
|
||||
log::error!("Could not find a focus target when in switching focus in {direction} direction for a {:?} dock", dock.position());
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue