Skip to content
This repository has been archived by the owner on Jul 31, 2018. It is now read-only.

Commit

Permalink
prevent crash when replication gives no doc ref #182
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain committed Sep 8, 2016
1 parent 63b9c4b commit 6cd5ca1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/middlewares/utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ module.exports.checkPermissionsPostReplication = (req, res, next) ->
next()
else if req.url.indexOf('/replication/_bulk_docs') is 0
# Use to add/update/delete a document in replication
async.forEach req.body.docs, (doc, cb) ->
docs = req.body.docs or []
async.forEach docs, (doc, cb) ->
if doc._deleted
# Document deletion:
# Get doc and check docType of current document
Expand Down

0 comments on commit 6cd5ca1

Please sign in to comment.