Handle no active editor available (#10503)

Cleaned up a stray `.unwrap()`

Release Notes:

- N/A
This commit is contained in:
Kyle Kelley 2024-04-15 16:53:08 -07:00 committed by GitHub
parent f5c2483423
commit 2a9ce3cec3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1119,8 +1119,8 @@ impl AssistantPanel {
)
.size_full()
.into_any_element()
} else {
let editor = self.active_conversation_editor().unwrap();
} else if let Some(editor) = self.active_conversation_editor() {
let editor = editor.clone();
let conversation = editor.read(cx).conversation.clone();
div()
.size_full()
@ -1135,6 +1135,8 @@ impl AssistantPanel {
.children(self.render_remaining_tokens(&conversation, cx)),
)
.into_any_element()
} else {
div().into_any_element()
},
))
}