Fix panic when trying to render a diagnostic that has no message

Antonio Scandurra created

Change summary

crates/editor/src/items.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

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()