Skip to content

Commit c1fbb49

Browse files
authored
Merge pull request #3511 from tonistiigi/bake-nil-panic
build: avoid panic on linking to nil target
2 parents 8e8054f + 1fae6f4 commit c1fbb49

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

build/build.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,9 +1074,12 @@ func waitContextDeps(ctx context.Context, index int, results *waitmap.Map, so *c
10741074
for _, v := range contexts {
10751075
if len(rr.Refs) > 0 {
10761076
for platform, r := range rr.Refs {
1077-
st, err := r.ToState()
1078-
if err != nil {
1079-
return err
1077+
st := llb.Scratch()
1078+
if r != nil {
1079+
st, err = r.ToState()
1080+
if err != nil {
1081+
return err
1082+
}
10801083
}
10811084
so.FrontendInputs[k+"::"+platform] = st
10821085
so.FrontendAttrs[v+"::"+platform] = "input:" + k + "::" + platform

0 commit comments

Comments
 (0)