mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-18 22:54:24 +01:00
fix: handle empty extensions (#2272)
This commit is contained in:
@@ -126,7 +126,11 @@ impl ExtensionConfigManager {
|
|||||||
/// Get all extensions and their configurations
|
/// Get all extensions and their configurations
|
||||||
pub fn get_all() -> Result<Vec<ExtensionEntry>> {
|
pub fn get_all() -> Result<Vec<ExtensionEntry>> {
|
||||||
let config = Config::global();
|
let config = Config::global();
|
||||||
let extensions: HashMap<String, ExtensionEntry> = config.get_param("extensions")?;
|
let extensions: HashMap<String, ExtensionEntry> = match config.get_param("extensions") {
|
||||||
|
Ok(exts) => exts,
|
||||||
|
Err(super::ConfigError::NotFound(_)) => HashMap::new(),
|
||||||
|
Err(e) => return Err(e.into()),
|
||||||
|
};
|
||||||
Ok(Vec::from_iter(extensions.values().cloned()))
|
Ok(Vec::from_iter(extensions.values().cloned()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user