Skip to content

Commit

Permalink
🐛 fix(api): Fixed crash, when region without an owner is deleted.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nachwahl committed Jan 22, 2023
1 parent 0ffb494 commit 96f9e0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/controllers/RegionsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class RegionsController {
}
});
if (region) {
if (region.owner.ssoId === request.kauth.grant.access_token.content.sub
if (region.owner?.ssoId === request.kauth.grant.access_token.content.sub
|| request.kauth.grant.access_token.content.realm_access.roles.includes("mapadmin")) {
await this.core.getPrisma().region.delete({
where: {
Expand Down

0 comments on commit 96f9e0e

Please sign in to comment.