diff --git a/src/Components/ResendNotifyHandler/ResendNotifyHandler.php b/src/Components/ResendNotifyHandler/ResendNotifyHandler.php index 80ac33d3..919f9d95 100644 --- a/src/Components/ResendNotifyHandler/ResendNotifyHandler.php +++ b/src/Components/ResendNotifyHandler/ResendNotifyHandler.php @@ -33,13 +33,19 @@ public function send(): void /** @var PayonePaymentNotificationQueueEntity $notification */ foreach ($notificationQueue as $notification) { - $messageDecode = base64_decode($notification->getMessage() ?: '', true); - /** @var NotificationForwardCommand $message */ - $message = unserialize($messageDecode, []); - - $this->notificationForwardHandler->handle($message, true); - $this->notificationQueueRepository->delete([['id' => $notification->getId()]], Context::createDefaultContext()); + $messageDecode = null; + if ($notification->getMessage() !== null) { + $messageDecode = base64_decode($notification->getMessage(), true); + } + if ($messageDecode !== null) { + /** @var NotificationForwardCommand $message */ + $message = unserialize($messageDecode, []); + + $this->notificationForwardHandler->handle($message, true); + $this->notificationQueueRepository->delete([['id' => $notification->getId()]], Context::createDefaultContext()); + } } + echo 'current time: ' . $currentDate->format(Defaults::STORAGE_DATE_TIME_FORMAT) . "\n"; } }