mirror of https://github.com/vacp2p/nim-libp2p.git
don't use nil result
This commit is contained in:
parent
5a00510b1f
commit
946b9580c0
|
@ -256,6 +256,7 @@ proc dial*(s: Switch,
|
||||||
if conn.closed:
|
if conn.closed:
|
||||||
raise newException(CatchableError, "Connection dead on arrival")
|
raise newException(CatchableError, "Connection dead on arrival")
|
||||||
|
|
||||||
|
result = conn
|
||||||
let stream = await s.getMuxedStream(peer)
|
let stream = await s.getMuxedStream(peer)
|
||||||
if not isNil(stream):
|
if not isNil(stream):
|
||||||
trace "Connection is muxed, return muxed stream"
|
trace "Connection is muxed, return muxed stream"
|
||||||
|
|
Loading…
Reference in New Issue