|
@@ -5,6 +5,8 @@ import (
|
|
|
"errors"
|
|
|
"strconv"
|
|
|
"time"
|
|
|
+
|
|
|
+ "github.com/docker/docker/errdefs"
|
|
|
)
|
|
|
|
|
|
// ContainerResize changes the size of the TTY of the process running
|
|
@@ -48,6 +50,10 @@ func (daemon *Daemon) ContainerExecResize(name string, height, width int) error
|
|
|
|
|
|
select {
|
|
|
case <-ec.Started:
|
|
|
+ // An error may have occurred, so ec.Process may be nil.
|
|
|
+ if ec.Process == nil {
|
|
|
+ return errdefs.InvalidParameter(errors.New("exec process is not started"))
|
|
|
+ }
|
|
|
return ec.Process.Resize(context.Background(), uint32(width), uint32(height))
|
|
|
case <-timeout.C:
|
|
|
return errors.New("timeout waiting for exec session ready")
|