fix: a domain may not have status

This commit is contained in:
Maël Gangloff
2024-07-23 14:30:21 +02:00
parent fa11235270
commit 75789b750d
3 changed files with 50 additions and 5 deletions

View File

@@ -87,11 +87,9 @@ readonly class RDAPService
$domain = $this->domainRepository->findOneBy(["ldhName" => strtolower($res['ldhName'])]);
if ($domain === null) $domain = new Domain();
$domain
->setTld($tld)
->setLdhName($res['ldhName'])
->setStatus($res['status']);
$domain->setTld($tld)->setLdhName($res['ldhName']);
if (array_key_exists('status', $res)) $domain->setStatus($res['status']);
if (array_key_exists('handle', $res)) $domain->setHandle($res['handle']);
$this->em->persist($domain);