Skip to content

Commit faea957

Browse files
fix: resolve undefined date error #247
1 parent d960f51 commit faea957

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,8 @@ const generateReport = async (options) => {
402402

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

410408
if (json.projectStatus.conditions) {
411409
for (const condition of json.projectStatus.conditions) {

0 commit comments

Comments
 (0)