From c03c49d48244191c5cd23c2565505a263d3ee19b Mon Sep 17 00:00:00 2001 From: rustdesk Date: Mon, 21 Mar 2022 00:53:35 +0800 Subject: [PATCH] bug --- src/ipc.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ipc.rs b/src/ipc.rs index 2e3b8af57..ae2db0bc6 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -521,10 +521,11 @@ pub fn set_option(key: &str, value: &str) { #[tokio::main(flavor = "current_thread")] pub async fn set_options(value: HashMap) -> ResultType<()> { - let mut c = connect(1000, "").await?; - c.send(&Data::Options(Some(value.clone()))).await?; - // do not put below before connect, because we need to check should_exit - c.next_timeout(1000).await.ok(); + if let Ok(mut c) = connect(1000, "").await { + c.send(&Data::Options(Some(value.clone()))).await?; + // do not put below before connect, because we need to check should_exit + c.next_timeout(1000).await.ok(); + } Config::set_options(value); Ok(()) }