Skip to content

Commit

Permalink
Fix panic #36
Browse files Browse the repository at this point in the history
  • Loading branch information
dalance committed Nov 22, 2020
1 parent 1be5f12 commit c0f8fe3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/pipeline_finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,17 @@ impl PipelineFinder {
return false;
}

let reader = fs::read_dir(&path).unwrap();
for i in reader {
match i {
Ok(entry) => {
if entry.path().ends_with(".gitignore") {
self.ignore_git.push(IgnoreGit::new(&entry.path()));
return true;
if let Ok(reader) = fs::read_dir(&path) {
for i in reader {
match i {
Ok(entry) => {
if entry.path().ends_with(".gitignore") {
self.ignore_git.push(IgnoreGit::new(&entry.path()));
return true;
}
}
Err(e) => self.errors.push(format!("Error: {}", e)),
}
Err(e) => self.errors.push(format!("Error: {}", e)),
}
}
false
Expand Down

0 comments on commit c0f8fe3

Please sign in to comment.