Skip to content

Commit 508bb2d

Browse files
authored
Update entrypoint.js
1 parent b364346 commit 508bb2d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

entrypoint.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ const processLambda = function () {
406406
const processReport = function () {
407407
try {
408408
if (cmdOPS === 'REPORT') {
409-
utilities.printTableWithJSON(securityReports.vulnerabilities.map((v, idx) => {
409+
const vulnerabilities = securityReports.vulnerabilities || []
410+
utilities.printTableWithJSON(vulnerabilities.map((v, idx) => {
410411
securityServerity.critical += v.severity == 'Critical' ? 1 : 0
411412
securityServerity.high += v.severity == 'High' ? 1 : 0
412413
securityServerity.medium += v.severity == 'Medium' ? 1 : 0
@@ -415,9 +416,9 @@ const processReport = function () {
415416
return {
416417
index: idx + 1,
417418
name: v.name.truncateLeft(30),
418-
severity: v.severity,
419-
category: v.category,
420-
identifier: v.identifiers.map(i => i.type == 'cwe' ? i.name : undefined).filter(o => o),
419+
severity: v.severity || '',
420+
category: v.category || '',
421+
identifier: (v.identifiers || []).map(i => i.type == 'cwe' ? i.name : undefined).filter(o => o),
421422
location: v.location.file.truncateLeft(30)
422423
}
423424
}))

0 commit comments

Comments
 (0)