From d4c512cb3fbb5da741b3f5ade1e66b6f5b4d5630 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 7 Sep 2016 19:34:59 +0300 Subject: [PATCH] handle the case where the object is not set at all #5018 --- src/meta/configs.js | 1 + src/meta/settings.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/meta/configs.js b/src/meta/configs.js index bbb5b3a387..723e58083d 100644 --- a/src/meta/configs.js +++ b/src/meta/configs.js @@ -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)) { diff --git a/src/meta/settings.js b/src/meta/settings.js index 6f14a33a8a..4fba3fcb2e 100644 --- a/src/meta/settings.js +++ b/src/meta/settings.js @@ -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)) {