Skip to content

Commit

Permalink
fix: check if PURL is nil
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <knqyf263@gmail.com>
  • Loading branch information
knqyf263 committed Oct 2, 2024
1 parent 9ed5d88 commit 9c26be0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/fanal/applier/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func ApplyLayers(layers []ftypes.BlobInfo) ftypes.ArtifactDetail {
mergedLayer.Packages[i].InstalledFiles = installedFiles
}

if mergedLayer.OS.Family != "" {
if mergedLayer.OS.Family != "" && pkg.Identifier.PURL == nil {
mergedLayer.Packages[i].Identifier.PURL = newPURL(mergedLayer.OS.Family, types.Metadata{OS: &mergedLayer.OS}, pkg)
}
mergedLayer.Packages[i].Identifier.UID = dependency.UID("", pkg)
Expand Down

0 comments on commit 9c26be0

Please sign in to comment.