From 01103da5d9b15e2a7fdc2f1dfec2c23a890d5c16 Mon Sep 17 00:00:00 2001 From: Alexey Kiryushin Date: Tue, 29 Sep 2020 19:07:09 +0100 Subject: [PATCH] fix(client): fix panic when addrs in ConnectingTcpRemote is empty (#2292) Closes #2291 --- src/client/connect/http.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/connect/http.rs b/src/client/connect/http.rs index 1dbd232b2c..d61dce3a6a 100644 --- a/src/client/connect/http.rs +++ b/src/client/connect/http.rs @@ -541,7 +541,13 @@ impl ConnectingTcpRemote { } } - Err(err.take().expect("missing connect error")) + match err { + Some(e) => Err(e), + None => Err(std::io::Error::new( + std::io::ErrorKind::NotConnected, + "Network unreachable", + )), + } } }