handle the case where the object is not set at all #5018

v1.18.x
barisusakli 8 years ago
parent 3c0a28d293
commit d4c512cb3f

@ -123,6 +123,7 @@ module.exports = function(Meta) {
if (err) { if (err) {
return callback(err); return callback(err);
} }
data = data || {};
var empty = {}; var empty = {};
Object.keys(values).forEach(function(key) { Object.keys(values).forEach(function(key) {
if (!data.hasOwnProperty(key)) { if (!data.hasOwnProperty(key)) {

@ -43,6 +43,7 @@ module.exports = function(Meta) {
if (err) { if (err) {
return callback(err); return callback(err);
} }
settings = settings || {};
var empty = {}; var empty = {};
Object.keys(values).forEach(function(key) { Object.keys(values).forEach(function(key) {
if (!settings.hasOwnProperty(key)) { if (!settings.hasOwnProperty(key)) {

Loading…
Cancel
Save