Skip to content

Commit 68e394d

Browse files
committedNov 9, 2015
fix; dont flatten empty arrays in updateValidators (Fix #3554)
1 parent f0b0f61 commit 68e394d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎lib/services/updateValidators.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ function modifiedPaths(update, path, result) {
159159
var val = update[key];
160160

161161
result[path + key] = true;
162-
163162
if (shouldFlatten(val)) {
164163
modifiedPaths(val, path + key, result);
165164
}
@@ -194,5 +193,6 @@ function shouldFlatten(val) {
194193
return val &&
195194
typeof val === 'object' &&
196195
!(val instanceof Date) &&
197-
!(val instanceof ObjectId);
196+
!(val instanceof ObjectId) &&
197+
(!Array.isArray(val) || val.length > 0);
198198
}

0 commit comments

Comments
 (0)
Please sign in to comment.