From 7f0d304f3767d4f33d23480a3ca2f54bb72938b7 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Wed, 6 Jan 2016 18:56:41 +0800 Subject: [PATCH] Check nil Terminal to avoid panic Signed-off-by: Zhang Wei --- container/container.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/container/container.go b/container/container.go index a4ae82cf20..8e9de55a15 100644 --- a/container/container.go +++ b/container/container.go @@ -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 }