Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix panic in diff hunk rendering (#50163)

Conrad Irwin845328662d59
diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs
index a04e16683d9..8131cdcb9e9 100644
--- a/crates/editor/src/element.rs
+++ b/crates/editor/src/element.rs
@@ -5580,7 +5580,11 @@ impl EditorElement {
continue;
}
let row_ix = display_row_range.start.0.saturating_sub(row_range.start.0);
- if row_infos[row_ix as usize].diff_status.is_none() {
+ if row_infos
+ .get(row_ix as usize)
+ .and_then(|row_info| row_info.diff_status)
+ .is_none()
+ {
continue;
}
if highlighted_rows