mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-14 16:51:18 +10:00
fix(download dir): fix logic error in detecting dir
This commit is contained in:
@ -103,7 +103,7 @@ pub fn add_new_download_dir(new_dir: String) -> Result<(), String> {
|
|||||||
let metadata = new_dir_path
|
let metadata = new_dir_path
|
||||||
.metadata()
|
.metadata()
|
||||||
.map_err(|e| format!("Unable to access file or directory: {}", e.to_string()))?;
|
.map_err(|e| format!("Unable to access file or directory: {}", e.to_string()))?;
|
||||||
if metadata.is_dir() {
|
if !metadata.is_dir() {
|
||||||
return Err("Invalid path: not a directory".to_string());
|
return Err("Invalid path: not a directory".to_string());
|
||||||
}
|
}
|
||||||
let dir_contents = new_dir_path
|
let dir_contents = new_dir_path
|
||||||
|
|||||||
Reference in New Issue
Block a user