Skip to content

Commit

Permalink
fix(core): ensure merging of data to already loaded entities won't fa…
Browse files Browse the repository at this point in the history
…il in some cases

Closes #4688
  • Loading branch information
B4nan committed Sep 12, 2023
1 parent 9496979 commit f6e8204
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/entity/EntityFactory.ts
Expand Up @@ -134,7 +134,7 @@ export class EntityFactory {
const prop = meta.properties[key];

if ([ReferenceType.MANY_TO_ONE, ReferenceType.ONE_TO_ONE].includes(prop.reference) && Utils.isPlainObject(data[prop.name])) {
diff2[key] = helper(entity[prop.name]).getPrimaryKey(options.convertCustomTypes);
diff2[key] = entity[prop.name] ? helper(entity[prop.name]).getPrimaryKey(options.convertCustomTypes) : null;
}

originalEntityData[key] = diff2[key] === null ? nullVal : diff2[key];
Expand Down

0 comments on commit f6e8204

Please sign in to comment.