mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Return an empty config if nil
Since the Config is a read-only entity, Confg() method returned a value instead of the pointer. In cases the config is nil, we should return an empty config. Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
parent
95e9118d7e
commit
c85a58b6df
1 changed files with 3 additions and 0 deletions
|
@ -169,6 +169,9 @@ func (c *controller) hostLeaveCallback(hosts []net.IP) {
|
||||||
func (c *controller) Config() config.Config {
|
func (c *controller) Config() config.Config {
|
||||||
c.Lock()
|
c.Lock()
|
||||||
defer c.Unlock()
|
defer c.Unlock()
|
||||||
|
if c.cfg == nil {
|
||||||
|
return config.Config{}
|
||||||
|
}
|
||||||
return *c.cfg
|
return *c.cfg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue