Explorar o código

Merge pull request #3972 from crosbymichael/fix-release-panic

Check for nil information return
unclejack %!s(int64=11) %!d(string=hai) anos
pai
achega
1a12e9fbc6
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      networkdriver/lxc/driver.go

+ 4 - 0
networkdriver/lxc/driver.go

@@ -353,6 +353,10 @@ func Release(job *engine.Job) engine.Status {
 		proto              string
 		proto              string
 	)
 	)
 
 
+	if containerInterface == nil {
+		return job.Errorf("No network information to release for %s", id)
+	}
+
 	for _, nat := range containerInterface.PortMappings {
 	for _, nat := range containerInterface.PortMappings {
 		if err := portmapper.Unmap(nat); err != nil {
 		if err := portmapper.Unmap(nat); err != nil {
 			log.Printf("Unable to unmap port %s: %s", nat, err)
 			log.Printf("Unable to unmap port %s: %s", nat, err)