Skip to content

Commit 6da45fc

Browse files
committed
Fix test and make code a bit more robust
1 parent 1b880f6 commit 6da45fc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

node/spec/repository.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"vulnerabilities": [
44
{ "atOrAbove": "1.6.0-rc.1", "below": "1.6.0-rc.1.1", "info": ["http://some.url"] },
55
{ "below": "1.5.0", "info": ["http://some.url"] },
6-
{ "atOrAbove": "1.8.0", "below": "1.9.0", "info": ["http://some.url"] }
6+
{ "atOrAbove": "1.8.0", "below": "1.9.0", "info": ["http://some.url"], "cwe":[ "CWE-79"], "identifiers": { "CVE": ["CVE-2021-1234"], "githubID": "GHSA-1234" } }
77
],
88
"extractors": {
99
"uri": ["/([0-9.]+([a-z\\-0-9.]+)?)/jquery(\\.min)?\\.js"],

node/src/reporters/cyclonedx-1_6-json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function configureCycloneDXJSONLogger(logger: Logger, writer: Writer, config: Lo
9494
const bomRef = purl;
9595
dep.vulnerabilities?.forEach((vuln) => {
9696
// Pick valid identifiers for VEX
97-
const ids: string[] | undefined = vuln.identifiers.CVE ?? (vuln.identifiers.githubID ? [vuln.identifiers.githubID] : undefined);
97+
const ids: string[] | undefined = vuln.identifiers?.CVE ?? (vuln.identifiers?.githubID ? [vuln.identifiers.githubID] : undefined);
9898
if (!ids) return;
9999
ids.forEach((id) => {
100100
if (!vulnerabilitiesCyclone.has(id)) {

0 commit comments

Comments
 (0)