Explorar o código

Merge pull request #1185 from ulyssessouza/fix-array-out-of-bounds

Add defensive code
Guillaume Tardif %!s(int64=4) %!d(string=hai) anos
pai
achega
1693fbdf34
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      local/compose/create.go

+ 3 - 0
local/compose/create.go

@@ -315,6 +315,9 @@ func getVolumesFrom(project *types.Project, volumesFrom []string) ([]string, []s
 	}
 	for _, vol := range volumesFrom {
 		spec := strings.Split(vol, ":")
+		if len(spec) == 0 {
+			continue
+		}
 		if spec[0] == "container" {
 			volumes = append(volumes, strings.Join(spec[1:], ":"))
 			continue