소스 검색

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