mirror of https://github.com/hashicorp/consul
Merge pull request #10046 from hashicorp/clone-panic
Don't panic on nil UpstreamConfiguration.Clone()pull/10048/head
commit
928d3a6d30
|
@ -217,6 +217,10 @@ type UpstreamConfiguration struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *UpstreamConfiguration) Clone() *UpstreamConfiguration {
|
func (c *UpstreamConfiguration) Clone() *UpstreamConfiguration {
|
||||||
|
if c == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var c2 UpstreamConfiguration
|
var c2 UpstreamConfiguration
|
||||||
if len(c.Overrides) > 0 {
|
if len(c.Overrides) > 0 {
|
||||||
c2.Overrides = make([]*UpstreamConfig, 0, len(c.Overrides))
|
c2.Overrides = make([]*UpstreamConfig, 0, len(c.Overrides))
|
||||||
|
|
Loading…
Reference in New Issue