From 93bffd9a7fc0806c5951cb20096001440b7213ab Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Tue, 7 Feb 2023 20:50:15 +0100 Subject: [PATCH] prevent assignment to entry in nil map Signed-off-by: Nicolas De Loof --- pkg/compose/build.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/compose/build.go b/pkg/compose/build.go index 1543852be2..1c2b0455ab 100644 --- a/pkg/compose/build.go +++ b/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