From 605794a9efa52df7a20a377d3448dc078bda5529 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 4 Aug 2026 21:29:39 +0800 Subject: duckduckgo: remove invalid images --- qml_plugin/src/web/duckduckgo.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qml_plugin/src/web/duckduckgo.rs b/qml_plugin/src/web/duckduckgo.rs index 6de39af..b87d5af 100644 --- a/qml_plugin/src/web/duckduckgo.rs +++ b/qml_plugin/src/web/duckduckgo.rs @@ -145,7 +145,15 @@ pub async fn query(input: &str) -> anyhow::Result { // TODO: try also Results[*].Icon.URL and RelatedTopics[*].Icon.URL image: resp .image - .and_then(|i| Url::parse(&format!("{DUCKDUCKGO}{i}",)).ok()), + .and_then( + |i| { + if !i.is_empty() { + Url::parse(&format!("{DUCKDUCKGO}{i}",)).ok() + } else { + None + } + }, + ), }, ) } -- cgit v1.2.3