Skip to content

Commit

Permalink
fix(cast): backport fix from #7290 to 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jan 20, 2019
1 parent 29f6709 commit edf70e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cast.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ module.exports = function cast(schema, obj, options, context) {
}
}
}
} else if (val.constructor.name === 'Array' && ['Buffer', 'Array'].indexOf(schematype.instance) === -1) {
} else if (Array.isArray(val) && ['Buffer', 'Array'].indexOf(schematype.instance) === -1) {
var casted = [];
for (var valIndex = 0; valIndex < val.length; valIndex++) {
casted.push(schematype.castForQueryWrapper({
Expand Down

0 comments on commit edf70e4

Please sign in to comment.