1
Fork 0

Improve soundness

This commit is contained in:
Jake Howard 2023-09-03 15:58:06 +01:00
parent cd76558dff
commit 38fe58ea9b
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -27,14 +27,14 @@ impl DokkuApp {
return None; return None;
} }
let current_vhosts = read_to_string(&vhost_path).await.unwrap(); let current_vhosts = read_to_string(&vhost_path).await.ok()?;
if current_vhosts.is_empty() { if current_vhosts.is_empty() {
return None; return None;
} }
Some(DokkuApp { Some(DokkuApp {
name: String::from(path.file_name().unwrap().to_str().unwrap()), name: String::from(path.file_name()?.to_str()?),
hosts: current_vhosts.lines().map(String::from).collect(), hosts: current_vhosts.lines().map(String::from).collect(),
}) })
} }