diff --git a/scripts/job-rcrm-status-migration-v2/backup.js b/scripts/job-rcrm-status-migration-v2/backup.js index bf19b4b7..fb41f35c 100644 --- a/scripts/job-rcrm-status-migration-v2/backup.js +++ b/scripts/job-rcrm-status-migration-v2/backup.js @@ -25,7 +25,7 @@ async function backup () { where: { rcrmStatus: 'Open' } }) for (const j of jbsInDb) { - if (jobs.indexOf(j.externalId) < 0) { + if (j.externalId && jobs.indexOf(j.externalId) < 0) { // The open job exists in taas but not showing up on Community-App backupJobs.push(j.externalId) }