Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Do not unwrap when updating inline diagnostics (#31814)
Kirill Bulatov4f1728e5ee0b
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex 82769927340..dfd526b7e8a 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -15703,15 +15703,14 @@ impl Editor {None};self.inline_diagnostics_update = cx.spawn_in(window, async move |editor, cx| {- let editor = editor.upgrade().unwrap();-if let Some(debounce) = debounce {cx.background_executor().timer(debounce).await;}- let Some(snapshot) = editor- .update(cx, |editor, cx| editor.buffer().read(cx).snapshot(cx))- .ok()- else {+ let Some(snapshot) = editor.upgrade().and_then(|editor| {+ editor+ .update(cx, |editor, cx| editor.buffer().read(cx).snapshot(cx))+ .ok()+ }) else {return;};