Don't panic on nil UpstreamConfiguration.Clone()

This commit is contained in:
freddygv 2021-04-15 15:46:21 -06:00
parent 8293eedace
commit 25dfa0ce24
1 changed files with 4 additions and 0 deletions

View File

@ -217,6 +217,10 @@ type UpstreamConfiguration struct {
}
func (c *UpstreamConfiguration) Clone() *UpstreamConfiguration {
if c == nil {
return nil
}
var c2 UpstreamConfiguration
if len(c.Overrides) > 0 {
c2.Overrides = make([]*UpstreamConfig, 0, len(c.Overrides))