check for nil observers
This commit is contained in:
parent
ccd019b328
commit
6196d56fc2
|
@ -83,7 +83,7 @@ proc send*(p: PubSubPeer, msgs: seq[RPCMsg]) {.async.} =
|
||||||
trace "sending msgs to peer", toPeer = p.id
|
trace "sending msgs to peer", toPeer = p.id
|
||||||
let encoded = encodeRpcMsg(m)
|
let encoded = encodeRpcMsg(m)
|
||||||
# trigger hooks
|
# trigger hooks
|
||||||
if p.observers[].len > 0:
|
if not(isNil(p.observers)) and p.observers[].len > 0:
|
||||||
var mm = m
|
var mm = m
|
||||||
for obs in p.observers[]:
|
for obs in p.observers[]:
|
||||||
obs.onSend(p, mm)
|
obs.onSend(p, mm)
|
||||||
|
|
Loading…
Reference in New Issue