Skip to content

Commit

Permalink
fix: extra check for null entity
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaledgarbaya committed Dec 21, 2017
1 parent 3629ff3 commit 0ecb63d
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 0ecb63d

Please sign in to comment.