Check for no valid search paths to prevent panic

This commit is contained in:
DJRHails 2020-05-19 12:40:32 +01:00 committed by David Peter
parent 42719624a8
commit 28d6a4f518
1 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,11 @@ fn run() -> Result<ExitCode> {
}
}
// Check if we have no valid search paths.
if dir_vec.is_empty() {
anyhow!("No valid search paths given.");
}
if matches.is_present("absolute-path") {
dir_vec = dir_vec
.iter()