Skip to content

Commit edf70e4

Browse files
committedJan 20, 2019
fix(cast): backport fix from #7290 to 4.x
1 parent 29f6709 commit edf70e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/cast.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ module.exports = function cast(schema, obj, options, context) {
255255
}
256256
}
257257
}
258-
} else if (val.constructor.name === 'Array' && ['Buffer', 'Array'].indexOf(schematype.instance) === -1) {
258+
} else if (Array.isArray(val) && ['Buffer', 'Array'].indexOf(schematype.instance) === -1) {
259259
var casted = [];
260260
for (var valIndex = 0; valIndex < val.length; valIndex++) {
261261
casted.push(schematype.castForQueryWrapper({

0 commit comments

Comments
 (0)
Please sign in to comment.