Skip to content

Commit

Permalink
blsforme/entry: Invalid cmdline files shouldn't be fatal.
Browse files Browse the repository at this point in the history
Signed-off-by: Ikey Doherty <[email protected]>
  • Loading branch information
ikeycode committed Jan 2, 2025
1 parent cad290a commit cc7698c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions blsforme/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ impl<'a> Entry<'a> {

let entries = std::fs::read_dir(&cmdline_d)?;

for entry in entries {
let entry = entry?;
for entry in entries.filter_map(Result::ok) {
let name = entry.file_name().to_string_lossy().to_string();
let snippet = cmdline_snippet(entry.path())?;
self.cmdline.push(CmdlineEntry { name, snippet });
// Don't bomb out on invalid cmdline snippets
if let Ok(snippet) = cmdline_snippet(entry.path()) {
self.cmdline.push(CmdlineEntry { name, snippet });
}
}

Ok(())
Expand Down

0 comments on commit cc7698c

Please sign in to comment.