From 6fc0000c8ad5b594d2096c98bc29672234526bec Mon Sep 17 00:00:00 2001 From: link2xt Date: Mon, 20 May 2024 18:59:19 +0000 Subject: [PATCH] fix: do not log warning if iroh relay metadata is NIL --- src/imap.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/imap.rs b/src/imap.rs index 7d46ead63..3053f4247 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -1472,13 +1472,15 @@ impl Session { admin = m.value; } "/shared/vendor/deltachat/irohrelay" => { - if let Some(url) = m.value.as_deref().and_then(|s| Url::parse(s).ok()) { - iroh_relay = Some(url); - } else { - warn!( - context, - "Got invalid URL from iroh relay metadata: {:?}.", m.value - ); + if let Some(value) = m.value { + if let Ok(url) = Url::parse(&value) { + iroh_relay = Some(url); + } else { + warn!( + context, + "Got invalid URL from iroh relay metadata: {:?}.", value + ); + } } } _ => {}