Skip to content

Commit

Permalink
fix: rare bug while merging locale data
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikrut committed May 4, 2022
1 parent 5df3b35 commit 47c37e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fields/hooks/beforeChange/promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const promise = async ({
if (typeof siblingData[field.name] === 'undefined') {
// If no incoming data, but existing document data is found, merge it in
if (typeof siblingDoc[field.name] !== 'undefined') {
if (field.localized && typeof siblingDoc[field.name] === 'object') {
if (field.localized && typeof siblingDoc[field.name] === 'object' && siblingDoc[field.name] !== null) {
siblingData[field.name] = siblingDoc[field.name][req.locale];
} else {
siblingData[field.name] = siblingDoc[field.name];
Expand Down

0 comments on commit 47c37e0

Please sign in to comment.