From 5ec68197056fbb63abba847b61bf447fed955359 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Fri, 28 Feb 2014 15:39:24 -0800 Subject: [PATCH] Check if the command exists before dereference Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes (github: creack) --- container.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container.go b/container.go index 7e15761c37..ede3cfd79f 100644 --- a/container.go +++ b/container.go @@ -839,7 +839,7 @@ func (container *Container) cleanup() { if err := container.stderr.CloseWriters(); err != nil { utils.Errorf("%s: Error close stderr: %s", container.ID, err) } - if container.command.Terminal != nil { + if container.command != nil && container.command.Terminal != nil { if err := container.command.Terminal.Close(); err != nil { utils.Errorf("%s: Error closing terminal: %s", container.ID, err) }