diff --git a/src/Controller/WatchListController.php b/src/Controller/WatchListController.php index 5647d23..4a47e30 100644 --- a/src/Controller/WatchListController.php +++ b/src/Controller/WatchListController.php @@ -157,8 +157,9 @@ class WatchListController extends AbstractController private function verifyWebhookDSN(WatchList $watchList): void { - if (null !== $watchList->getWebhookDsn()) { - foreach ($watchList->getWebhookDsn() as $dsnString) { + $webhookDsn = $watchList->getWebhookDsn(); + if (null !== $webhookDsn && 0 !== count($webhookDsn)) { + foreach ($webhookDsn as $dsnString) { try { $dsn = new Dsn($dsnString); } catch (InvalidArgumentException $exception) { diff --git a/src/MessageHandler/ProcessDomainTriggerHandler.php b/src/MessageHandler/ProcessDomainTriggerHandler.php index ff67db6..db7df13 100644 --- a/src/MessageHandler/ProcessDomainTriggerHandler.php +++ b/src/MessageHandler/ProcessDomainTriggerHandler.php @@ -133,8 +133,9 @@ final readonly class ProcessDomainTriggerHandler */ private function sendChatNotification(WatchList $watchList, ChatNotificationInterface $notification): void { - if (null !== $watchList->getWebhookDsn()) { - foreach ($watchList->getWebhookDsn() as $dsnString) { + $webhookDsn = $watchList->getWebhookDsn(); + if (null !== $webhookDsn && 0 !== count($webhookDsn)) { + foreach ($webhookDsn as $dsnString) { $dsn = new Dsn($dsnString); $scheme = $dsn->getScheme();