Skip to content

Commit 7daa2a5

Browse files
authored
Merge pull request docker#10250 from ndeloof/nil_build_args
prevent assignment to entry in nil map
2 parents 9a4e74c + 93bffd9 commit 7daa2a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/compose/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
303303
}
304304

305305
func flatten(in types.MappingWithEquals) types.Mapping {
306+
out := types.Mapping{}
306307
if len(in) == 0 {
307-
return nil
308+
return out
308309
}
309-
out := types.Mapping{}
310310
for k, v := range in {
311311
if v == nil {
312312
continue

0 commit comments

Comments
 (0)