From 2a155d484931b05c41f56e5eac7592247694406b Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Thu, 6 Aug 2020 23:17:35 +0200 Subject: [PATCH] adapt repl-tool to new peerstate api introduced with #1800 --- examples/repl/cmdline.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/repl/cmdline.rs b/examples/repl/cmdline.rs index b6fd67a3d..14f5b338d 100644 --- a/examples/repl/cmdline.rs +++ b/examples/repl/cmdline.rs @@ -284,12 +284,13 @@ async fn log_contactlist(context: &Context, contacts: &[u32]) { "addr unset" } ); - let peerstate = Peerstate::from_addr(context, &addr).await; - if peerstate.is_some() && contact_id != 1 as libc::c_uint { - line2 = format!( - ", prefer-encrypt={}", - peerstate.as_ref().unwrap().prefer_encrypt - ); + if let Ok(peerstate) = Peerstate::from_addr(context, &addr).await { + if peerstate.is_some() && contact_id != 1 as libc::c_uint { + line2 = format!( + ", prefer-encrypt={}", + peerstate.as_ref().unwrap().prefer_encrypt + ); + } } println!("Contact#{}: {}{}", contact_id, line, line2);