From 36bdf8a67e687db0db4037c955ba203abd8cb193 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 23 Mar 2024 22:11:17 +0000 Subject: [PATCH] fix: do not ignore Contact::get_by_id() error in from_field_to_contact_id() --- src/receive_imf.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 494eacc89..752f3e3d6 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -628,12 +628,9 @@ pub async fn from_field_to_contact_id( if from_id == ContactId::SELF { Ok(Some((ContactId::SELF, false, Origin::OutgoingBcc))) } else { - let mut from_id_blocked = false; - let mut incoming_origin = Origin::Unknown; - if let Ok(contact) = Contact::get_by_id(context, from_id).await { - from_id_blocked = contact.blocked; - incoming_origin = contact.origin; - } + let contact = Contact::get_by_id(context, from_id).await?; + let from_id_blocked = contact.blocked; + let incoming_origin = contact.origin; Ok(Some((from_id, from_id_blocked, incoming_origin))) } }