Skip to content

Commit 01103da

Browse files
authored
fix(client): fix panic when addrs in ConnectingTcpRemote is empty (#2292)
Closes #2291
1 parent 523d66a commit 01103da

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/client/connect/http.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,13 @@ impl ConnectingTcpRemote {
541541
}
542542
}
543543

544-
Err(err.take().expect("missing connect error"))
544+
match err {
545+
Some(e) => Err(e),
546+
None => Err(std::io::Error::new(
547+
std::io::ErrorKind::NotConnected,
548+
"Network unreachable",
549+
)),
550+
}
545551
}
546552
}
547553

0 commit comments

Comments
 (0)