From b5a4458b68cdda5f24c2721beec2fe7a0a05c477 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Wed, 15 Feb 2017 14:12:36 +0000 Subject: [PATCH] check sha1 hash value only if present --- services/document-updater/app/coffee/RedisManager.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/document-updater/app/coffee/RedisManager.coffee b/services/document-updater/app/coffee/RedisManager.coffee index d9f210f1d6..ab95d1129f 100644 --- a/services/document-updater/app/coffee/RedisManager.coffee +++ b/services/document-updater/app/coffee/RedisManager.coffee @@ -67,7 +67,9 @@ module.exports = RedisManager = multi.exec (error, [docLines, version, storedHash, doc_project_id, ranges])-> timer.done() return callback(error) if error? - if docLines? + + # check sha1 hash value if present + if docLines? and storedHash? computedHash = RedisManager._computeHash(docLines) if computedHash isnt storedHash logger.error project_id: project_id, doc_id: doc_id, doc_project_id: doc_project_id, computedHash: computedHash, storedHash: storedHash, "hash mismatch on retrieved document"