mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-30 20:24:08 +00:00
agent_servers: Fix panic when setting default mode (#42452)
Closes ZED-35A Release Notes: - Fixed an issue where Zed would panic when trying to set the default mode for ACP agents
This commit is contained in:
parent
28d019be2e
commit
ee2e690657
1 changed files with 4 additions and 3 deletions
|
|
@ -50,13 +50,14 @@ impl crate::AgentServer for CustomAgentServer {
|
|||
fn set_default_mode(&self, mode_id: Option<acp::SessionModeId>, fs: Arc<dyn Fs>, cx: &mut App) {
|
||||
let name = self.name();
|
||||
update_settings_file(fs, cx, move |settings, _| {
|
||||
settings
|
||||
if let Some(settings) = settings
|
||||
.agent_servers
|
||||
.get_or_insert_default()
|
||||
.custom
|
||||
.get_mut(&name)
|
||||
.unwrap()
|
||||
.default_mode = mode_id.map(|m| m.to_string())
|
||||
{
|
||||
settings.default_mode = mode_id.map(|m| m.to_string())
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue