Skip to content

Commit

Permalink
Merge pull request micro#417 from unistack-org/gossip
Browse files Browse the repository at this point in the history
registry: [gossip] fix panic
  • Loading branch information
asim committed Feb 13, 2019
2 parents d2fdbcc + f961c57 commit c372287
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions registry/gossip/gossip.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,11 @@ func (g *gossipRegistry) run() {
case <-ticker.C:
var addrs []string
g.RLock()
for node, action := range g.members {
if action == nodeActionLeave && g.member.LocalNode().Address() != node {
addrs = append(addrs, node)
if g.member != nil {
for node, action := range g.members {
if action == nodeActionLeave && g.member.LocalNode().Address() != node {
addrs = append(addrs, node)
}
}
}
g.RUnlock()
Expand Down

0 comments on commit c372287

Please sign in to comment.