From ae13fcc771b9c23eddcfde8808140fc39fd0103d Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Tue, 26 Jul 2022 15:07:39 -0300 Subject: [PATCH] Make sure $metas[] is always set for all subscribers in the foreach loop See https://github.com/mailpoet/mailpoet/pull/4247#pullrequestreview-1050167548 [MAILPOET-4379] --- mailpoet/lib/Cron/Workers/SendingQueue/SendingQueue.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mailpoet/lib/Cron/Workers/SendingQueue/SendingQueue.php b/mailpoet/lib/Cron/Workers/SendingQueue/SendingQueue.php index 7c7221d265..ce6f94ea90 100644 --- a/mailpoet/lib/Cron/Workers/SendingQueue/SendingQueue.php +++ b/mailpoet/lib/Cron/Workers/SendingQueue/SendingQueue.php @@ -284,6 +284,8 @@ class SendingQueue { $subscriberEntity = $this->subscribersRepository->findOneById($subscriber->id); if ($subscriberEntity instanceof SubscriberEntity) { $metas[] = $this->mailerMetaInfo->getNewsletterMetaInfo($newsletter, $subscriberEntity); + } else { + $metas[] = []; } // keep track of values for statistics purposes