Skip to content

Commit

Permalink
fix(checkVulnerabilities): Validate data before usage
Browse files Browse the repository at this point in the history
  • Loading branch information
brikendr committed Feb 10, 2022
1 parent b259530 commit 22af4c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/checkVulnerabilities.js
Expand Up @@ -21,7 +21,7 @@ function checkForVulnerabilities() {
try {
const stdout = execSync('npm audit --production --json || true');
const vulnerabilityReportJson = JSON.parse(stdout.toString());
const vulnerabilityData = vulnerabilityReportJson['advisories'];
const vulnerabilityData = vulnerabilityReportJson['advisories'] || {};
let shouldFail = false;
let skippedChecks = 0;
Object.keys(vulnerabilityData).forEach((advisoryKey) => {
Expand Down

0 comments on commit 22af4c7

Please sign in to comment.