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(); + } } }