From 9a9452dcc814931503a1267bc0ef52b6ab9837ba Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 25 Oct 2022 18:58:52 +0100 Subject: [PATCH] Fix panic in `GetPeers` that may happen mid-link setup --- src/core/api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/api.go b/src/core/api.go index 0fa6dd33..8e9186ac 100644 --- a/src/core/api.go +++ b/src/core/api.go @@ -62,6 +62,9 @@ func (c *Core) GetPeers() []PeerInfo { names := make(map[net.Conn]string) phony.Block(&c.links, func() { for _, info := range c.links._links { + if info == nil { + continue + } names[info.conn] = info.lname } })