Skip to content

Commit a2ac368

Browse files
committed
Attempted fix for a crash reported on Discord
1 parent cf0338d commit a2ac368

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

epaint/src/text/text_layout.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ fn rows_from_paragraphs(
172172
});
173173
} else {
174174
line_break(fonts, &paragraph, job, &mut rows);
175-
rows.last_mut().unwrap().ends_with_newline = !is_last_paragraph;
175+
if let Some(last_row) = rows.last_mut() {
176+
last_row.ends_with_newline = !is_last_paragraph;
177+
}
176178
}
177179
}
178180
}

0 commit comments

Comments
 (0)