Skip to content

Commit

Permalink
fix hasSBOM to manage the nil hasSBOMList
Browse files Browse the repository at this point in the history
Signed-off-by: mrizzi <[email protected]>
  • Loading branch information
mrizzi committed Sep 26, 2024
1 parent 01ac417 commit 1d5cf15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/assembler/backends/ent/backend/sbom.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,10 @@ func (b *EntBackend) HasSBOM(ctx context.Context, spec *model.HasSBOMSpec) ([]*m
return nil, errors.Wrap(err, funcName)
}
var result []*model.HasSbom
for _, edge := range hasSBOMList.Edges {
result = append(result, edge.Node)
if hasSBOMList != nil {
for _, edge := range hasSBOMList.Edges {
result = append(result, edge.Node)
}
}
return result, nil
}
Expand Down

0 comments on commit 1d5cf15

Please sign in to comment.