fix: webhook_dsn can be an empty array

This commit is contained in:
Maël Gangloff
2024-08-25 03:55:20 +02:00
parent 0e1658f6fe
commit cbdca2c401
2 changed files with 6 additions and 4 deletions

View File

@@ -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();