Skip to content

Commit

Permalink
avoid segmentation fault in member cleanup (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
charless-splunk authored Apr 5, 2019
1 parent bd65609 commit 570fa16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions embetcd/memberInfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ func (m *Members) Get(member *membership.Member) (info *Member) {
// Try creating the client to the node if it doesn't exist
// If we get repeated errors creating the client to the member,
// then the member will eventually fail it's health check and be removed.
if info.Client == nil {
if info.Client == nil && member != nil && member.ClientURLs != nil {
info.Client, _ = NewClient(clientv3.Config{Endpoints: member.ClientURLs})
}

// update the info with the incoming membership
info.Member = member

// update the member client endpoints
if member != nil && member.ClientURLs != nil {
if info.Client != nil && member != nil && member.ClientURLs != nil {
info.Client.SetEndpoints(member.ClientURLs...)
}

Expand Down

0 comments on commit 570fa16

Please sign in to comment.