Skip to content

Commit

Permalink
fix: added check for existing key in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroymoore committed Sep 21, 2022
1 parent d856544 commit 04c00bc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/lib/ecosystems/resolve-test-facts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,14 @@ export async function resolveAndTestFactsRegistry(

const vulnerabilities: IssueData[] = [];
for (const issuesDataKey in response.issuesData) {
const issueData = response.issuesData[issuesDataKey];
const pkgCoordinate = `${issuesMap[issuesDataKey].pkgName}@${issuesMap[issuesDataKey].pkgVersion}`;
issueData.from = [pkgCoordinate];
issueData.name = pkgCoordinate;
issueData.packageManager = packageManager;
vulnerabilities.push(issueData);
if (issuesMap[issuesDataKey]) {
const issueData = response.issuesData[issuesDataKey];
const pkgCoordinate = `${issuesMap[issuesDataKey].pkgName}@${issuesMap[issuesDataKey].pkgVersion}`;
issueData.from = [pkgCoordinate];
issueData.name = pkgCoordinate;
issueData.packageManager = packageManager;
vulnerabilities.push(issueData);
}
}

const dependencyCount = response?.depGraphData?.graph?.nodes?.find(
Expand Down

0 comments on commit 04c00bc

Please sign in to comment.