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 {
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
if c.cfg == nil {
|
||||
return config.Config{}
|
||||
}
|
||||
return *c.cfg
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue