From 2a283b915282511714502d09f9531dd94e96ca8d Mon Sep 17 00:00:00 2001 From: Jan Oppolzer Date: Thu, 22 Feb 2024 17:34:54 +0100 Subject: [PATCH] Fix EntityController.php 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. --- app/Http/Controllers/EntityController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/EntityController.php b/app/Http/Controllers/EntityController.php index de233c0..84e1f90 100644 --- a/app/Http/Controllers/EntityController.php +++ b/app/Http/Controllers/EntityController.php @@ -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(); + } } }