check that content exists before adding it to getAllDocs.

causing error which I think is blowing up the mongo driver elsewhere
This commit is contained in:
Henry Oswald 2015-02-18 21:25:53 +00:00
parent 766bfbf5ef
commit 21a01d94d4

View file

@ -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