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

This commit is contained in:
barisusakli
2016-09-07 19:34:59 +03:00
parent 3c0a28d293
commit d4c512cb3f
2 changed files with 2 additions and 0 deletions

View File

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

View File

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