Skip to content

Commit

Permalink
fix: resolve undefined date error #247
Browse files Browse the repository at this point in the history
  • Loading branch information
thecampagnards committed Apr 25, 2024
1 parent d960f51 commit faea957
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,8 @@ const generateReport = async (options) => {

// get date for quality gate status, day month year format
data.qualityGateStatusPeriodDate = new Date(
json.projectStatus.period.date
)
.toISOString()
.substring(0, 10);
json.projectStatus.period?.date ?? (json.projectStatus.periods.length > 0 ? json.projectStatus.periods[0].date : undefined)
).toISOString().substring(0, 10);

if (json.projectStatus.conditions) {
for (const condition of json.projectStatus.conditions) {
Expand Down

0 comments on commit faea957

Please sign in to comment.