Bladeren bron

Check if the command exists before dereference

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Guillaume J. Charmes 11 jaren geleden
bovenliggende
commit
5ec6819705
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      container.go

+ 1 - 1
container.go

@@ -839,7 +839,7 @@ func (container *Container) cleanup() {
 	if err := container.stderr.CloseWriters(); err != nil {
 	if err := container.stderr.CloseWriters(); err != nil {
 		utils.Errorf("%s: Error close stderr: %s", container.ID, err)
 		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 {
 		if err := container.command.Terminal.Close(); err != nil {
 			utils.Errorf("%s: Error closing terminal: %s", container.ID, err)
 			utils.Errorf("%s: Error closing terminal: %s", container.ID, err)
 		}
 		}