Skip to content

Commit

Permalink
fix: add error handling for missing join columns (#10525)
Browse files Browse the repository at this point in the history
Closes: #7034
  • Loading branch information
PleBea committed Dec 29, 2023
1 parent d76b546 commit 122c897
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/query-builder/SelectQueryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2348,6 +2348,11 @@ export class SelectQueryBuilder<Entity extends ObjectLiteral>
})
.join(" AND ")

if (!condition)
throw new TypeORMError(
`Relation ${relation.entityMetadata.name}.${relation.propertyName} does not have join columns.`,
)

return (
" " +
joinAttr.direction +
Expand Down

0 comments on commit 122c897

Please sign in to comment.