diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/import.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/src/import.rs b/server/src/import.rs index 374c2c7..3b45f14 100644 --- a/server/src/import.rs +++ b/server/src/import.rs @@ -55,7 +55,13 @@ pub async fn import_path( None } }); - let identifier = path.file_name().unwrap().to_str().unwrap().to_string(); + let identifier = if mpath.exists() { + path.file_name().unwrap().to_str().unwrap().to_string() + } else { + parent + .clone() + .ok_or(anyhow!("non-root node requires parent"))? + }; let all = join_all( children_paths |