do not silently ingnore peerstate error in repl; in repl it is okay to panic/unwrap

This commit is contained in:
B. Petersen
2020-08-07 09:25:40 +02:00
committed by link2xt
parent a3ecbb3809
commit 35c250c705

View File

@@ -284,13 +284,14 @@ async fn log_contactlist(context: &Context, contacts: &[u32]) {
"addr unset" "addr unset"
} }
); );
if let Ok(peerstate) = Peerstate::from_addr(context, &addr).await { let peerstate = Peerstate::from_addr(context, &addr)
if peerstate.is_some() && contact_id != 1 as libc::c_uint { .await
line2 = format!( .expect("peerstate error");
", prefer-encrypt={}", if peerstate.is_some() && contact_id != 1 as libc::c_uint {
peerstate.as_ref().unwrap().prefer_encrypt line2 = format!(
); ", prefer-encrypt={}",
} peerstate.as_ref().unwrap().prefer_encrypt
);
} }
println!("Contact#{}: {}{}", contact_id, line, line2); println!("Contact#{}: {}{}", contact_id, line, line2);