mirror of
https://github.com/vacp2p/nim-libp2p-experimental.git
synced 2025-01-12 03:14:15 +00:00
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
|
||||
let encoded = encodeRpcMsg(m)
|
||||
# trigger hooks
|
||||
if p.observers[].len > 0:
|
||||
if not(isNil(p.observers)) and p.observers[].len > 0:
|
||||
var mm = m
|
||||
for obs in p.observers[]:
|
||||
obs.onSend(p, mm)
|
||||
|
Loading…
x
Reference in New Issue
Block a user