Check more failure cases
This commit is contained in:
parent
099094f719
commit
a2d0385eba
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue