1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #19121 from WeiZhang555/tty-resize

Check nil Terminal to avoid panic
This commit is contained in:
Tibor Vass 2016-01-11 11:29:15 -05:00
commit 47074030f6

View file

@ -232,6 +232,9 @@ func (container *Container) ExitOnNext() {
// Resize changes the TTY of the process running inside the container
// to the given height and width. The container must be running.
func (container *Container) Resize(h, w int) error {
if container.Command.ProcessConfig.Terminal == nil {
return fmt.Errorf("Container %s does not have a terminal ready", container.ID)
}
if err := container.Command.ProcessConfig.Terminal.Resize(h, w); err != nil {
return err
}