QFIX: Child info could be empty (#3785)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-10-04 12:57:24 +07:00 committed by GitHub
parent 9a4fa752de
commit c6065d094a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,7 +103,7 @@ async function fixSpentTime (client: MigrationClient): Promise<void> {
const issues = await client.find<Issue>(DOMAIN_TASK, { reportedTime: { $gt: 0 } })
for (const issue of issues) {
const childInfo = issue.childInfo
for (const child of childInfo) {
for (const child of childInfo ?? []) {
child.reportedTime = child.reportedTime * 8
}
await client.update(DOMAIN_TASK, { _id: issue._id }, { reportedTime: issue.reportedTime * 8, childInfo })