Skip to content

Commit

Permalink
feat: extra check for null entity
Browse files Browse the repository at this point in the history
closes #74
  • Loading branch information
Khaledgarbaya committed Dec 21, 2017
1 parent 3629ff3 commit 6f27d85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/push/push-to-space.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function archiveEntities (ctx, task, entities, sourceEntities) {
.map(({original}) => original.sys.id)

const entitiesToArchive = entities
.filter((entity) => entityIdsToArchive.includes(entity.sys.id))
.filter((entity) => entity && entityIdsToArchive.includes(entity.sys.id))

return publishing.archiveEntities(entitiesToArchive)
}
Expand All @@ -306,7 +306,7 @@ function publishEntities (ctx, task, entities, sourceEntities) {

// Filter imported entities and publish only these who got published in the source
const entitiesToPublish = entities
.filter((entity) => entityIdsToPublish.includes(entity.sys.id))
.filter((entity) => entity && entityIdsToPublish.includes(entity.sys.id))

return publishing.publishEntities(entitiesToPublish)
}

0 comments on commit 6f27d85

Please sign in to comment.