prevent assignment to entry in nil map

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2023-02-07 20:50:15 +01:00
parent 9a4e74c70c
commit 93bffd9a7f
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
1 changed files with 3 additions and 3 deletions

View File

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