Skip to content

Commit

Permalink
Merge branch 'master' into expirement/page_count
Browse files Browse the repository at this point in the history
  • Loading branch information
ysebyy authored Sep 11, 2024
2 parents 87496ec + a628313 commit 6bcf95f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion pkg/bomtools/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ func MergeSBOMs(mergedSbomParam MergeSBOMParam) (*cdx.BOM, error) {
if b.Components != nil {
components := *b.Components
for i := range components {
allComponents = append(allComponents, &components[i])
// Seems that sometimes the name can return empty
if components[i].Name != "" {
allComponents = append(allComponents, &components[i])
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/collectors/jvm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ func TestJVMCollector(t *testing.T) {
const bomRoot = "/tmp/some-random-dir"
executor := new(mockShellExecutor)

firstBOMComponents := []cdx.Component{{PackageURL: "pkg:gem/[email protected]"}}
firstBOMComponents := []cdx.Component{{PackageURL: "pkg:gem/[email protected]", Name: "addressable"}}
firstBOM := new(cdx.BOM)
firstBOM.Components = &firstBOMComponents

secondBOMComponents := []cdx.Component{{PackageURL: "pkg:gem/[email protected]"}}
secondBOMComponents := []cdx.Component{{PackageURL: "pkg:gem/[email protected]", Name: "addressable"}}
secondBOM := new(cdx.BOM)
secondBOM.Components = &secondBOMComponents

Expand Down

0 comments on commit 6bcf95f

Please sign in to comment.