From 3175f6d3a69cab4379b9613435c16854874fff92 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 3 Mar 2016 14:35:53 +0000 Subject: [PATCH] handle case where index does not exist --- services/track-changes/app/coffee/PackManager.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/track-changes/app/coffee/PackManager.coffee b/services/track-changes/app/coffee/PackManager.coffee index 4eba1bff2d..f6e4aa626c 100644 --- a/services/track-changes/app/coffee/PackManager.coffee +++ b/services/track-changes/app/coffee/PackManager.coffee @@ -281,7 +281,7 @@ module.exports = PackManager = return callback(err) if err? return callback() if not historyPacks? # select only the new packs not already in the index - newPacks = (pack for pack in historyPacks when not indexResult[pack._id]?) + newPacks = (pack for pack in historyPacks when not indexResult?[pack._id]?) newPacks = (_.omit(pack, 'doc_id', 'project_id', 'n', 'sz') for pack in newPacks) logger.log {project_id, doc_id, n: newPacks.length}, "found new packs" callback(null, newPacks)