Skip to content

Commit c82949f

Browse files
committed
gracefully fail if the update doesn't return results
1 parent 42824f8 commit c82949f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.git-blame-ignore-revs

Whitespace-only changes.

scripts/actions/check-job-progress.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,13 @@ const updateTranslationRecords = async (project_id, slugStatuses) => {
204204
{ status: StatusEnum.COMPLETED }
205205
);
206206

207-
console.log(
208-
`Translation ${records[0].id} marked as ${StatusEnum.COMPLETED}`
209-
);
207+
const id = records[0]?.id;
208+
209+
if (id == null) {
210+
console.log('Unable to update ${locale} translation for slug ${slug}');
211+
} else {
212+
console.log(`Translation ${id} marked as ${StatusEnum.COMPLETED}`);
213+
}
210214
})
211215
);
212216
};

0 commit comments

Comments
 (0)