Skip to content

Commit

Permalink
Merge pull request #48 from Level/allow-empty-value-in-batch
Browse files Browse the repository at this point in the history
allow empty value in batch
  • Loading branch information
juliangruber committed May 28, 2016
2 parents 6cff734 + 565f125 commit e6a9821
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion memdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ MemDOWN.prototype._batch = function (array, options, callback) {

if (array[i].type === 'put') {
value = this._isBuffer(array[i].value) ? array[i].value : String(array[i].value)
err = this._checkKey(value, 'value')
if (value === null || value === undefined)
err = new Error('value cannot be `null` or `undefined`')

if (err)
return setImmediate(function errorCall() { callback(err) })
Expand Down

0 comments on commit e6a9821

Please sign in to comment.