diff --git a/lib/discover/local.go b/lib/discover/local.go index 8ae0079b0..816523c06 100644 --- a/lib/discover/local.go +++ b/lib/discover/local.go @@ -124,13 +124,15 @@ func (c *localClient) announcementPkt() Announce { } var relays []Relay - for _, relay := range c.relayStat.Relays() { - latency, ok := c.relayStat.RelayStatus(relay) - if ok { - relays = append(relays, Relay{ - URL: relay, - Latency: int32(latency / time.Millisecond), - }) + if c.relayStat != nil { + for _, relay := range c.relayStat.Relays() { + latency, ok := c.relayStat.RelayStatus(relay) + if ok { + relays = append(relays, Relay{ + URL: relay, + Latency: int32(latency / time.Millisecond), + }) + } } }