Skip to content

Commit

Permalink
fix: initialize scores as an empty object
Browse files Browse the repository at this point in the history
  • Loading branch information
iuliag committed Jan 18, 2024
1 parent f461584 commit fb9d2ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/spacecat-shared-data-access/src/models/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ export const createAudit = (data) => {
throw new Error('Audit result must be an object');
}

if (!newState.scores) {
newState.scores = {};
}
validateScores(data.auditResult, data.auditType);

if (data.previousAuditResult && !isObject(data.previousAuditResult)) {
Expand Down

0 comments on commit fb9d2ee

Please sign in to comment.