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

Check if the command exists before dereference

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
This commit is contained in:
Guillaume J. Charmes 2014-02-28 15:39:24 -08:00
parent 31e08fdc96
commit 5ec6819705
No known key found for this signature in database
GPG key ID: B33E4642CB6E3FF3

View file

@ -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)
}