Fixed: a bug for range generatoion during week-end

The range generator failed during week-end, because no range is selected (lastStart and endDate is null).

with this commit, the rangeGenerator may return null instead of an array, which means no sms will be send.
This commit is contained in:
2022-12-12 13:09:31 +01:00
parent efe494d61f
commit 3c85b5ca92
4 changed files with 38 additions and 6 deletions

View File

@@ -51,8 +51,13 @@ class CalendarForShortMessageProvider
*/
public function getCalendars(DateTimeImmutable $at): iterable
{
['startDate' => $startDate, 'endDate' => $endDate] = $this->rangeGenerator
->generateRange($at);
$range = $this->rangeGenerator->generateRange($at);
if (null === $range) {
return;
}
['startDate' => $startDate, 'endDate' => $endDate] = $range;
$offset = 0;
$batchSize = 10;