mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-12-22 16:07:31 +00:00
Fix panic in GetPeers
that may happen mid-link setup
This commit is contained in:
parent
65e350153e
commit
9a9452dcc8
@ -62,6 +62,9 @@ func (c *Core) GetPeers() []PeerInfo {
|
|||||||
names := make(map[net.Conn]string)
|
names := make(map[net.Conn]string)
|
||||||
phony.Block(&c.links, func() {
|
phony.Block(&c.links, func() {
|
||||||
for _, info := range c.links._links {
|
for _, info := range c.links._links {
|
||||||
|
if info == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
names[info.conn] = info.lname
|
names[info.conn] = info.lname
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user