mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
lib/discovery: Handle nil relayService (fixes #2890)
This commit is contained in:
parent
d91e6023eb
commit
d01ea9d6fb
@ -124,13 +124,15 @@ func (c *localClient) announcementPkt() Announce {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var relays []Relay
|
var relays []Relay
|
||||||
for _, relay := range c.relayStat.Relays() {
|
if c.relayStat != nil {
|
||||||
latency, ok := c.relayStat.RelayStatus(relay)
|
for _, relay := range c.relayStat.Relays() {
|
||||||
if ok {
|
latency, ok := c.relayStat.RelayStatus(relay)
|
||||||
relays = append(relays, Relay{
|
if ok {
|
||||||
URL: relay,
|
relays = append(relays, Relay{
|
||||||
Latency: int32(latency / time.Millisecond),
|
URL: relay,
|
||||||
})
|
Latency: int32(latency / time.Millisecond),
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user