Add a nil check for sandbox.osSbox

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
This commit is contained in:
Santhosh Manohar 2016-11-15 09:49:00 -08:00
parent 6ab880f3b7
commit d07d6814f3
1 changed files with 7 additions and 1 deletions

View File

@ -427,7 +427,13 @@ func (sb *sandbox) ResolveIP(ip string) string {
}
func (sb *sandbox) ExecFunc(f func()) error {
return sb.osSbox.InvokeFunc(f)
sb.Lock()
osSbox := sb.osSbox
sb.Unlock()
if osSbox != nil {
return osSbox.InvokeFunc(f)
}
return fmt.Errorf("osl sandbox unavailable in ExecFunc for %v", sb.ContainerID())
}
func (sb *sandbox) ResolveService(name string) ([]*net.SRV, []net.IP) {