Fix bug saving falsy attributes

This commit is contained in:
Zaid Abdulla committed 2018-12-18 02:21:10 -08:00
1 parent e909d783e2
commit 85aadf6cb1
1 file changed
+1 -1
+1 -1
View File
@@ -654,7 +654,7 @@ function saveDevice(deviceId, deviceData, isNew, sessionTimestamp, callback) {
for (const attrName of Object.keys(diff[1])) {
if (
diff[1][attrName][1] != null &&
(!diff[2] || !diff[2][attrName] || !diff[2][attrName][1])
(!diff[2] || !diff[2][attrName] || diff[2][attrName][1] == null)
) {
update["$unset"][path.concat(`_${attrName}`).join(".")] = 1;
if (attrName === "value") {