add muxer nil check

This commit is contained in:
Jacek Sieka 2020-08-17 13:32:02 +02:00
parent cfcda3c3ef
commit 833a5b8e57
No known key found for this signature in database
GPG Key ID: A1B09461ABB656B8
1 changed files with 4 additions and 0 deletions

View File

@ -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)