Skip to content

Commit 020073b

Browse files
committed
llbsolver: fix possible panic when setting event to nil
When a record is marked for deletion the event is set to nil but we don't check if it's nil when sending events which could cause a panic. Signed-off-by: CrazyMax <[email protected]> (cherry picked from commit 9d39af0)
1 parent 5f41ca6 commit 020073b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

solver/llbsolver/history.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ func (h *HistoryQueue) Listen(ctx context.Context, req *controlapi.BuildHistoryR
819819
}
820820
h.mu.Unlock()
821821
for _, e := range events {
822-
if e.Record == nil {
822+
if e == nil || e.Record == nil {
823823
continue
824824
}
825825
if err := f(e); err != nil {

0 commit comments

Comments
 (0)