1
0
Fork 0
mirror of synced 2024-10-03 19:53:33 +13:00

Check more failure cases

This commit is contained in:
Jake Barnby 2024-01-15 18:28:40 +13:00
parent 099094f719
commit a2d0385eba
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -124,11 +124,21 @@ class Messaging extends Action
$recipients = \array_merge($recipients, $targets);
}
if (empty($recipients)) {
Console::error('No valid recipients found.');
return;
}
$fallback = $dbForProject->findOne('providers', [
Query::equal('enabled', [true]),
Query::equal('type', [$recipients[0]->getAttribute('providerType')]),
]);
if ($fallback === false) {
Console::error('No fallback provider found.');
return;
}
/**
* @var array<string, array<string>> $identifiers
*/