Skip to content

Commit

Permalink
fix(core): improve validation of wrong entity references (#3085)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Adámek <banan23@gmail.com>
  • Loading branch information
hcharley and B4nan committed May 6, 2022
1 parent fbf0e99 commit f5de135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/metadata/MetadataDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ export class MetadataDiscovery {

if (value instanceof Function) {
const meta2 = this.metadata.get(prop.type);
prop[type] = value(meta2.properties).name;
prop[type] = value(meta2.properties)?.name;

if (prop[type] == null) {
throw MetadataError.fromWrongReference(meta, prop, type as 'mappedBy' | 'inversedBy');
Expand Down

0 comments on commit f5de135

Please sign in to comment.