Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Apply Attestation: "TypeError: Cannot read properties of undefined (reading 'status')" #6616

Merged
merged 7 commits into from
Feb 13, 2025
Merged
5 changes: 4 additions & 1 deletion libs/hdf-converters/src/utils/attestations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ function attestationCanBeAdded(
control: ExecJSON.Control
) {
if (attestation.control_id.toLowerCase() === control.id.toLowerCase()) {
if (control.results[0].status === 'skipped') {
if (control.results.length === 0) {
// There are no results for this control. It may be part of an overlay file.
return false;
} else if (control.results[0].status === 'skipped') {
return true;
} else {
console.error(
Expand Down
Loading