lib/discovery: Handle nil relayService (fixes #2890)

This commit is contained in:
Jakob Borg 2016-03-27 11:37:43 +00:00 committed by Audrius Butkevicius
parent d91e6023eb
commit d01ea9d6fb

View File

@ -124,6 +124,7 @@ func (c *localClient) announcementPkt() Announce {
} }
var relays []Relay var relays []Relay
if c.relayStat != nil {
for _, relay := range c.relayStat.Relays() { for _, relay := range c.relayStat.Relays() {
latency, ok := c.relayStat.RelayStatus(relay) latency, ok := c.relayStat.RelayStatus(relay)
if ok { if ok {
@ -133,6 +134,7 @@ func (c *localClient) announcementPkt() Announce {
}) })
} }
} }
}
return Announce{ return Announce{
Magic: AnnouncementMagic, Magic: AnnouncementMagic,