Skip to content

Commit fc13e00

Browse files
authored
chore: add guard if image is really there and resolvable (#2213)
1 parent ecb96e7 commit fc13e00

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • crates/podfetch-web/src/services/download

crates/podfetch-web/src/services/download/service.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,7 @@ impl DownloadService {
602602
}
603603
};
604604

605-
if let 0 = tag.pictures().count() {
606-
let mut image_file = File::open(&paths.image_filename).unwrap();
605+
if let 0 = tag.pictures().count() && let Ok(mut image_file) = File::open(&paths.image_filename) {
607606
let mut image_data = Vec::new();
608607
let _ = image_file.read_to_end(&mut image_data);
609608
tag.add_frame(id3::frame::Picture {

0 commit comments

Comments
 (0)