Browse Source

Merge pull request #10250 from ndeloof/nil_build_args

prevent assignment to entry in nil map
Guillaume Lours 2 years ago
parent
commit
7daa2a5325
1 changed files with 2 additions and 2 deletions
  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