Skip to content

Commit

Permalink
avoid nil pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bresson committed Feb 3, 2017
1 parent 1a6c67d commit a49759f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion command/agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,10 @@ func (a *ClientConfig) Merge(b *ClientConfig) *ClientConfig {
if b.ClientMinPort != 0 {
result.ClientMinPort = b.ClientMinPort
}
if b.Reserved != nil {
if result.Reserved == nil && b.Reserved != nil {
reserved := *b.Reserved
result.Reserved = &reserved
} else if b.Reserved != nil {
result.Reserved = result.Reserved.Merge(b.Reserved)
}
if b.GCInterval != 0 {
Expand Down

0 comments on commit a49759f

Please sign in to comment.