diff --git a/pkg/assembler/backends/ent/backend/sbom.go b/pkg/assembler/backends/ent/backend/sbom.go index 8e00a577ab..362e25f493 100644 --- a/pkg/assembler/backends/ent/backend/sbom.go +++ b/pkg/assembler/backends/ent/backend/sbom.go @@ -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 }