From 3fc3e51a4442c5f2b8e9ecfacae4b740e7013bb2 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 11 Feb 2022 12:16:20 +0100 Subject: [PATCH] Fix panic when trying to render a diagnostic that has no message --- crates/editor/src/items.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 21c30c6f35..0e0a48b940 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -397,7 +397,7 @@ impl View for DiagnosticMessage { if let Some(diagnostic) = &self.diagnostic { let theme = &self.settings.borrow().theme.workspace.status_bar; Label::new( - diagnostic.message.lines().next().unwrap().to_string(), + diagnostic.message.split('\n').next().unwrap().to_string(), theme.diagnostic_message.clone(), ) .contained()