qfix: ensure target mappings are not undefined (#7936)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2025-02-05 22:43:25 +07:00
committed by GitHub
parent 62dfae97cb
commit 30839b6ba5
2 changed files with 5 additions and 5 deletions
@@ -608,7 +608,7 @@ export class ProjectsSyncManager implements DocSyncManager {
okit: Octokit
): Promise<{ projectStructure: GithubProjectV2, wasUpdates: boolean, mappings: GithubFieldMapping[] }> {
let projectStructure = await this.queryProjectStructure(integration, target)
let mappings = target.mappings
let mappings = target.mappings ?? []
if (projectStructure === undefined) {
if (this.client.getHierarchy().isDerived(tracker.class.Project, target._class)) {
@@ -651,7 +651,7 @@ export class ProjectsSyncManager implements DocSyncManager {
const mHash = JSON.stringify(mappings)
// Create any platform field into matching github field
for (const [, f] of allFields.entries()) {
const existingField = (mappings ?? []).find((it) => it._id === f._id)
const existingField = mappings.find((it) => it._id === f._id)
if (f.hidden === true) {
continue
}