Merge pull request #179 from thaJeztah/17.06-backport-fix_api_server_null

[17.06] Fix api server null pointer def on inspect/ls null ipam-driver networks
This commit is contained in:
Andrew Hsu
2017-08-08 01:08:24 -07:00
committed by GitHub
2 changed files with 18 additions and 1 deletions
@@ -398,7 +398,9 @@ func buildIpamResources(r *types.NetworkResource, nwInfo libnetwork.NetworkInfo)
for _, ip4Info := range ipv4Info {
iData := network.IPAMConfig{}
iData.Subnet = ip4Info.IPAMData.Pool.String()
iData.Gateway = ip4Info.IPAMData.Gateway.IP.String()
if ip4Info.IPAMData.Gateway != nil {
iData.Gateway = ip4Info.IPAMData.Gateway.IP.String()
}
r.IPAM.Config = append(r.IPAM.Config, iData)
}
}