diff --git a/services/track-changes/app/coffee/ConversionManager.coffee b/services/track-changes/app/coffee/ConversionManager.coffee index d7849818c0..fef745b220 100644 --- a/services/track-changes/app/coffee/ConversionManager.coffee +++ b/services/track-changes/app/coffee/ConversionManager.coffee @@ -40,7 +40,10 @@ module.exports = ConversionManager = compressedUpdates = [lastCompressedUpdate] for rawUpdate in rawUpdates lastCompressedUpdate = compressedUpdates.pop() - compressedUpdates = compressedUpdates.concat ConcatManager.concatTwoUpdates lastCompressedUpdate, rawUpdate + if lastCompressedUpdate? + compressedUpdates = compressedUpdates.concat ConcatManager.concatTwoUpdates lastCompressedUpdate, rawUpdate + else + compressedUpdates.push rawUpdate ConversionManager.removeLatestCompressedUpdate doc_id, (error) -> return callback(error) if error? callback null, compressedUpdates