瀏覽代碼

fix panic in monitor

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Victor Vieux 11 年之前
父節點
當前提交
1dfc440733
共有 1 個文件被更改,包括 1 次插入1 次删除
  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)
 	}
 
-	if container.runtime.srv.IsRunning() {
+	if container.runtime != nil && container.runtime.srv != nil && container.runtime.srv.IsRunning() {
 		container.State.SetStopped(exitCode)
 
 		// FIXME: there is a race condition here which causes this to fail during the unit tests.