one more check

v1.18.x
Julian Lam 7 years ago
parent 9751c4b8db
commit 4b25414c0b

@ -77,8 +77,12 @@ module.exports = function (User) {
} }
if (!Array.isArray(set) || !set.length || !set.every((item) => { if (!Array.isArray(set) || !set.length || !set.every((item) => {
if (!item) {
return false;
}
const check = item.hasOwnProperty(property) ? item[property] : item; 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); return callback(null, set);
} }

Loading…
Cancel
Save