From 21a01d94d4ea6f870aaae8d909639f10048649b4 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Wed, 18 Feb 2015 21:25:53 +0000 Subject: [PATCH] check that content exists before adding it to getAllDocs. causing error which I think is blowing up the mongo driver elsewhere --- .../Features/Project/ProjectEntityHandler.coffee | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee b/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee index e060c8ebd5..1ac7d78918 100644 --- a/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee +++ b/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee @@ -48,12 +48,13 @@ module.exports = ProjectEntityHandler = for folderPath, folder of folders for doc in folder.docs content = docContents[doc._id.toString()] - docs[path.join(folderPath, doc.name)] = { - _id: doc._id - name: doc.name - lines: content.lines - rev: content.rev - } + if content? + docs[path.join(folderPath, doc.name)] = { + _id: doc._id + name: doc.name + lines: content.lines + rev: content.rev + } logger.log count:_.keys(docs).length, project_id:project_id, "returning docs for project" callback null, docs