不要怂,就是干,撸起袖子干!

Commit 1d437cf8 by Sohum Banerjea

Buffers were not being cloned in find() or treated as primary keys

1 parent 14101e5e
Showing with 5 additions and 2 deletions
...@@ -526,7 +526,10 @@ module.exports = (function() { ...@@ -526,7 +526,10 @@ module.exports = (function() {
options = { where: parsedId } options = { where: parsedId }
} else if (typeof options === 'object') { } else if (typeof options === 'object') {
options = Utils._.clone(options) options = Utils._.clone(options, function(thing) {
if (Buffer.isBuffer(thing)) { return thing }
return undefined;
})
if (options.hasOwnProperty('include') && options.include) { if (options.hasOwnProperty('include') && options.include) {
hasJoin = true hasJoin = true
......
...@@ -348,7 +348,7 @@ var Utils = module.exports = { ...@@ -348,7 +348,7 @@ var Utils = module.exports = {
if (['number', 'string'].indexOf(typeof arg) !== -1) { if (['number', 'string'].indexOf(typeof arg) !== -1) {
result = true result = true
} else { } else {
result = (arg instanceof Date) result = (arg instanceof Date) || Buffer.isBuffer(arg);
} }
} }
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!