From 751e7dd3d92f46e8b8d8a86b12cd0598e4ff4d69 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 a03978cd0c79..5554f98528ef 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; + } } } }