Fix possible crash in tcptransport when server is nil
This commit is contained in:
parent
3514733060
commit
f7af2c2e5c
|
@ -50,8 +50,10 @@ method close*(t: TcpTransport): Future[void] {.async, gcsafe.} =
|
||||||
trace "stopping transport"
|
trace "stopping transport"
|
||||||
await procCall Transport(t).close() # call base
|
await procCall Transport(t).close() # call base
|
||||||
|
|
||||||
t.server.stop()
|
# server can be nil
|
||||||
t.server.close()
|
if t.server != nil:
|
||||||
|
t.server.stop()
|
||||||
|
t.server.close()
|
||||||
trace "transport stopped"
|
trace "transport stopped"
|
||||||
|
|
||||||
method listen*(t: TcpTransport,
|
method listen*(t: TcpTransport,
|
||||||
|
|
Loading…
Reference in New Issue