mirror of
https://github.com/faas-rs/faasd-in-rust.git
synced 2025-06-18 03:56:34 +00:00
fix(bug): replace unwrap() with unwrap_or_default() to propagate errors for better handling
This commit is contained in:
@ -492,8 +492,8 @@ impl ContainerdManager {
|
||||
|
||||
pub fn get_address(cid: &str) -> String {
|
||||
let map = GLOBAL_NETNS_MAP.read().unwrap();
|
||||
let config = map.get(cid).unwrap();
|
||||
config.get_address()
|
||||
let addr = map.get(cid).map(|net_conf| net_conf.get_address());
|
||||
addr.unwrap_or_default()
|
||||
}
|
||||
|
||||
fn remove_container_network_config(cid: &str) {
|
||||
|
Reference in New Issue
Block a user