one more check

This commit is contained in:
Julian Lam
2018-05-03 12:13:42 -04:00
parent 9751c4b8db
commit 4b25414c0b

View File

@@ -77,8 +77,12 @@ module.exports = function (User) {
}
if (!Array.isArray(set) || !set.length || !set.every((item) => {
if (!item) {
return false;
}
const check = item.hasOwnProperty(property) ? item[property] : item;
return item && ['number', 'string'].includes(typeof check);
return ['number', 'string'].includes(typeof check);
})) {
return callback(null, set);
}