Skip to content

Commit

Permalink
remote/cozy: Recover when changesfeed dir_id points to invalid doc (#925
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sebn authored Jan 19, 2018
1 parent dfb5b08 commit 776548a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/remote/cozy.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export default class RemoteCozy {
// File docs returned by the cozy-stack don't have a path
const parent = fileParentsById[doc.dir_id]

if (parent.error) {
log.error(`Could not retrieve path of file ${doc._id}: parent dir ${doc.dir_id}: ${parent.error}`)
if (parent.error || parent.doc == null || parent.doc.path == null) {
log.error({doc, parent}, 'Could not compute doc path from parent')
continue
} else {
doc.path = path.posix.join(parent.doc.path, doc.name)
Expand Down

0 comments on commit 776548a

Please sign in to comment.