don't use nil result

This commit is contained in:
Dmitriy Ryajov 2020-02-25 17:20:57 -06:00
parent 5a00510b1f
commit 946b9580c0
1 changed files with 1 additions and 0 deletions

View File

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