Skip to content

Commit

Permalink
Add a nil check for sandbox.osSbox
Browse files Browse the repository at this point in the history
Signed-off-by: Santhosh Manohar <[email protected]>
  • Loading branch information
Santhosh Manohar committed Nov 15, 2016
1 parent be377dc commit 95c683b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 95c683b

Please sign in to comment.