mirror of
https://github.com/logos-storage/nim-chronos.git
synced 2026-01-08 00:13:08 +00:00
Add sanity check. (#105)
This commit is contained in:
parent
319e2bfc09
commit
528688d01e
@ -1143,7 +1143,7 @@ else:
|
||||
var transp = cast[StreamTransport](cdata.udata)
|
||||
let fd = SocketHandle(cdata.fd)
|
||||
|
||||
if int(fd) == 0:
|
||||
if int(fd) == 0 or isNil(transp):
|
||||
## This situation can be happen, when there events present
|
||||
## after transport was closed.
|
||||
return
|
||||
@ -1286,7 +1286,7 @@ else:
|
||||
var cdata = cast[ptr CompletionData](udata)
|
||||
var transp = cast[StreamTransport](cdata.udata)
|
||||
let fd = SocketHandle(cdata.fd)
|
||||
if int(fd) == 0:
|
||||
if int(fd) == 0 or isNil(transp):
|
||||
## This situation can be happen, when there events present
|
||||
## after transport was closed.
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user