From a2ac368bdcc3db50b58acbcf6a0ccf3f0dce8a75 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sat, 9 Apr 2022 13:42:13 +0200 Subject: [PATCH] Attempted fix for a crash reported on Discord --- epaint/src/text/text_layout.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epaint/src/text/text_layout.rs b/epaint/src/text/text_layout.rs index a03978cd0c7..5554f98528e 100644 --- a/epaint/src/text/text_layout.rs +++ b/epaint/src/text/text_layout.rs @@ -172,7 +172,9 @@ fn rows_from_paragraphs( }); } else { line_break(fonts, ¶graph, job, &mut rows); - rows.last_mut().unwrap().ends_with_newline = !is_last_paragraph; + if let Some(last_row) = rows.last_mut() { + last_row.ends_with_newline = !is_last_paragraph; + } } } }