diff --git a/process.go b/process.go index ff7d838cd..42f3b84a9 100644 --- a/process.go +++ b/process.go @@ -111,9 +111,11 @@ func (p *process) Start(ctx context.Context) error { ExecID: p.id, }) if err != nil { - p.io.Cancel() - p.io.Wait() - p.io.Close() + if p.io != nil { + p.io.Cancel() + p.io.Wait() + p.io.Close() + } return errdefs.FromGRPC(err) } p.pid = r.Pid diff --git a/task.go b/task.go index 239b855d7..9deb66c7e 100644 --- a/task.go +++ b/task.go @@ -189,8 +189,10 @@ func (t *task) Start(ctx context.Context) error { ContainerID: t.id, }) if err != nil { - t.io.Cancel() - t.io.Close() + if t.io != nil { + t.io.Cancel() + t.io.Close() + } return errdefs.FromGRPC(err) } t.pid = r.Pid