Messy fix unti we got url sanitization.
Fixed a bug where program would panic if the Get Request to where the feed image is would fail.
This commit is contained in:
parent
86019710a1
commit
64cd388aeb
@ -158,7 +158,12 @@ pub fn cache_image(title: &str, image_uri: Option<&str>) -> Option<String> {
|
|||||||
return Some(dlpath);
|
return Some(dlpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
download_to(&dlpath, url).unwrap();
|
if let Err(err) = download_to(&dlpath, url) {
|
||||||
|
error!("Failed to get feed image.");
|
||||||
|
error!("Error: {}", err);
|
||||||
|
return None;
|
||||||
|
};
|
||||||
|
|
||||||
info!("Cached img into: {}", dlpath);
|
info!("Cached img into: {}", dlpath);
|
||||||
return Some(dlpath);
|
return Some(dlpath);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user