Skip to content

Commit

Permalink
solver: protect against nil dereference on uninitialized vertex
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Dec 19, 2024
1 parent 4ea0679 commit 983a32b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions solver/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,12 @@ func (j *Job) walkProvenance(ctx context.Context, e Edge, f func(ProvenanceProvi
visited[e.Vertex.Digest()] = struct{}{}
if st, ok := j.list.actives[e.Vertex.Digest()]; ok {
st.mu.Lock()
if wp, ok := st.op.op.(ProvenanceProvider); ok {
if err := f(wp); err != nil {
st.mu.Unlock()
return err
if st.op != nil && st.op.op != nil {
if wp, ok := st.op.op.(ProvenanceProvider); ok {
if err := f(wp); err != nil {
st.mu.Unlock()
return err
}
}
}
st.mu.Unlock()
Expand Down

0 comments on commit 983a32b

Please sign in to comment.