We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
pkgFilePaths
1 parent 9637286 commit 72ea4b0Copy full SHA for 72ea4b0
pkg/sbom/spdx/unmarshal.go
@@ -53,9 +53,6 @@ func (s *SPDX) UnmarshalJSON(b []byte) error {
53
if s.BOM == nil {
54
s.BOM = core.NewBOM(core.Options{})
55
}
56
- if s.pkgFilePaths == nil {
57
- s.pkgFilePaths = make(map[common.ElementID]string)
58
- }
59
60
spdxDocument, err := json.Read(bytes.NewReader(b))
61
if err != nil {
@@ -71,6 +68,10 @@ func (s *SPDX) UnmarshalJSON(b []byte) error {
71
68
func (s *SPDX) unmarshal(spdxDocument *spdx.Document) error {
72
69
s.trivySBOM = s.isTrivySBOM(spdxDocument)
73
70
+ if s.pkgFilePaths == nil {
+ s.pkgFilePaths = make(map[common.ElementID]string)
+ }
74
+
75
// Parse files and find file paths for packages
76
s.parseFiles(spdxDocument)
77
0 commit comments