Skip to content

Commit

Permalink
Fix EntityController.php (#18)
Browse files Browse the repository at this point in the history
In case that IdP isn't a member of eduID.cz, it's not tied to any
EduidczOrganization within LDAP (for example an IdP of Standalone
federation). This fix skips trying to delete non existent LDAP entry.
  • Loading branch information
JanOppolzer authored Feb 22, 2024
1 parent 9b8bbe6 commit 7111094
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Http/Controllers/EntityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,9 @@ public function destroy(Entity $entity)
if (! app()->environment('testing')) {
if ($entity->type->value === 'idp' && ! $entity->hfd) {
$eduidczOrganization = EduidczOrganization::whereEntityIDofIdP($entity->entityid)->first();
$eduidczOrganization->delete();
if (!is_null($eduidczOrganization)) {
$eduidczOrganization->delete();
}
}
}

Expand Down

0 comments on commit 7111094

Please sign in to comment.