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
1 changed files with 2 additions and 2 deletions

View File

@ -27,14 +27,14 @@ impl DokkuApp {
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() {
return None;
}
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(),
})
}