don't crash when no dir

This commit is contained in:
Mylloon 2024-12-06 10:12:12 +01:00
parent 2b811359f4
commit cd1dafdc26
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -36,7 +36,11 @@ pub fn get_filetree(
exclusion_list: &[String],
exclusion_patterns: &[Regex],
) -> FileNode {
gen_filetree(initial_dir, exclusion_list, exclusion_patterns).unwrap()
gen_filetree(initial_dir, exclusion_list, exclusion_patterns).unwrap_or(FileNode {
name: String::new(),
is_dir: false,
children: vec![],
})
}
fn gen_filetree(