Skip to content

Commit 3cabacf

Browse files
committed
control: make sure sending nil cache options does not panic
Signed-off-by: Tonis Tiigi <[email protected]>
1 parent b85a5b1 commit 3cabacf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

control/control.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,9 @@ func (c *Controller) Solve(ctx context.Context, req *controlapi.SolveRequest) (*
376376
atomic.AddInt64(&c.buildCount, 1)
377377
defer atomic.AddInt64(&c.buildCount, -1)
378378

379+
if req.Cache == nil {
380+
req.Cache = &controlapi.CacheOptions{} // make sure cache options are initialized
381+
}
379382
translateLegacySolveRequest(req)
380383

381384
defer func() {

0 commit comments

Comments
 (0)