Skip to content

Commit c1e289d

Browse files
author
Ilianna Papastefanou
committed
fix: iac test result undefined
snyk iac test scan would fail when trying to access snykIacTestScanResult?.scanAnalytics.supressedResults, in the case of snykIacTestScanResult being undefined. This is because the whole snykIacTestScanResult?.scanAnalytics would evaluate to undefine and suppressedResults would fail to read an undefined value. Added a "?" operator to scanAnalytics to fix this error.
1 parent 51450a5 commit c1e289d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib/formatters/iac-output/text/formatters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function formatSnykIacTestTestData(
111111

112112
let contextSuppressedIssueCount: number | undefined;
113113
const suppressedResults =
114-
snykIacTestScanResult?.scanAnalytics.suppressedResults;
114+
snykIacTestScanResult?.scanAnalytics?.suppressedResults;
115115
if (suppressedResults) {
116116
contextSuppressedIssueCount = Object.values(suppressedResults).reduce(
117117
function(count, resourcesForRuleId) {

0 commit comments

Comments
 (0)