From 19e671ff25bffa47424b5af44264c2c74c2cc84b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 3 Jul 2023 20:20:26 +0200 Subject: [PATCH] Fix dataurl parse panic when icon is malformed --- src/api/icons.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/icons.rs b/src/api/icons.rs index e650386f..dcf985f7 100644 --- a/src/api/icons.rs +++ b/src/api/icons.rs @@ -682,7 +682,7 @@ async fn download_icon(domain: &str) -> Result<(Bytes, Option<&str>), Error> { for icon in icon_result.iconlist.iter().take(5) { if icon.href.starts_with("data:image") { - let datauri = DataUrl::process(&icon.href).unwrap(); + let Ok(datauri) = DataUrl::process(&icon.href) else {continue}; // Check if we are able to decode the data uri let mut body = BytesMut::new(); match datauri.decode::<_, ()>(|bytes| {