Skip to content

Commit 7e96015

Browse files
authored
Merge pull request #3168 from tonistiigi/bake-call-empty
bake: fix nil deference on empty call definition
2 parents 9e17bc7 + b00dd42 commit 7e96015

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

commands/bake.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,18 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba
261261
return err
262262
}
263263

264-
for _, opt := range bo {
264+
for k, opt := range bo {
265265
if opt.CallFunc != nil {
266266
cf, err := buildflags.ParseCallFunc(opt.CallFunc.Name)
267267
if err != nil {
268268
return err
269269
}
270-
opt.CallFunc.Name = cf.Name
270+
if cf == nil {
271+
opt.CallFunc = nil
272+
bo[k] = opt
273+
} else {
274+
opt.CallFunc.Name = cf.Name
275+
}
271276
}
272277
}
273278

0 commit comments

Comments
 (0)