From 776548a00dee9e55a60421dfb15f2073b0ca57d7 Mon Sep 17 00:00:00 2001 From: sebn Date: Fri, 19 Jan 2018 11:26:16 +0100 Subject: [PATCH] remote/cozy: Recover when changesfeed dir_id points to invalid doc (#925) --- core/remote/cozy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/remote/cozy.js b/core/remote/cozy.js index e78de0f34..ea00594ed 100644 --- a/core/remote/cozy.js +++ b/core/remote/cozy.js @@ -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)