Преглед изворни кода

Merge pull request #10250 from ndeloof/nil_build_args

prevent assignment to entry in nil map
Guillaume Lours пре 2 година
родитељ
комит
7daa2a5325
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      pkg/compose/build.go

+ 2 - 2
pkg/compose/build.go

@@ -303,10 +303,10 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
 }
 
 func flatten(in types.MappingWithEquals) types.Mapping {
+	out := types.Mapping{}
 	if len(in) == 0 {
-		return nil
+		return out
 	}
-	out := types.Mapping{}
 	for k, v := range in {
 		if v == nil {
 			continue