Browse Source

fix panic in monitor

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Victor Vieux 11 years ago
parent
commit
1dfc440733
1 changed files with 1 additions and 1 deletions
  1. 1 1
      runtime/container.go

+ 1 - 1
runtime/container.go

@@ -785,7 +785,7 @@ func (container *Container) monitor(callback execdriver.StartCallback) error {
 		utils.Errorf("Error running container: %s", err)
 		utils.Errorf("Error running container: %s", err)
 	}
 	}
 
 
-	if container.runtime.srv.IsRunning() {
+	if container.runtime != nil && container.runtime.srv != nil && container.runtime.srv.IsRunning() {
 		container.State.SetStopped(exitCode)
 		container.State.SetStopped(exitCode)
 
 
 		// FIXME: there is a race condition here which causes this to fail during the unit tests.
 		// FIXME: there is a race condition here which causes this to fail during the unit tests.