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; + } } } }