Procházet zdrojové kódy

Merge pull request #10250 from ndeloof/nil_build_args

prevent assignment to entry in nil map
Guillaume Lours před 2 roky
rodič
revize
7daa2a5325
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  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