mirror of
https://github.com/logos-storage/nim-libp2p.git
synced 2026-01-05 23:23:12 +00:00
add muxer nil check
This commit is contained in:
parent
cfcda3c3ef
commit
833a5b8e57
@ -220,6 +220,10 @@ proc upgradeOutgoing(s: Switch, conn: Connection): Future[Connection] {.async, g
|
|||||||
|
|
||||||
trace "upgrading connection"
|
trace "upgrading connection"
|
||||||
let muxer = await s.mux(sconn) # mux it if possible
|
let muxer = await s.mux(sconn) # mux it if possible
|
||||||
|
if muxer == nil:
|
||||||
|
# TODO this might be relaxed in the future
|
||||||
|
raise newException(CatchableError,
|
||||||
|
"a muxer is required for outgoing connections")
|
||||||
|
|
||||||
await s.identify(muxer)
|
await s.identify(muxer)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user