Skip to content

Commit

Permalink
fix(cable): filter out non-utf8 lines when loading cable candidates (#…
Browse files Browse the repository at this point in the history
…263)

Fixes #262
  • Loading branch information
alexpasmantier authored Jan 9, 2025
1 parent 510b528 commit 9433fea
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions crates/television-channels/src/channels/cable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,15 @@ async fn load_candidates(command: String, injector: Injector<String>) {
let reader = BufReader::new(out);
let mut produced_output = false;

#[allow(clippy::manual_flatten)]
for line in reader.lines() {
let line = line.unwrap();
if !line.trim().is_empty() {
let () = injector.push(line, |e, cols| {
cols[0] = e.clone().into();
});
produced_output = true;
if let Ok(l) = line {
if !l.trim().is_empty() {
let () = injector.push(l, |e, cols| {
cols[0] = e.clone().into();
});
produced_output = true;
}
}
}

Expand Down

0 comments on commit 9433fea

Please sign in to comment.