Properly handle nullable newsletter in response builder

[MAILPOET-2818]
This commit is contained in:
Rostislav Wolny
2020-04-08 08:54:46 +02:00
committed by Veljko V
parent bbde4b1c1c
commit 1a0745337d

View File

@ -198,7 +198,7 @@ class NewslettersResponseBuilder {
'deleted_at' => ($deletedAt = $queue->getDeletedAt()) ? $deletedAt->format(self::DATE_FORMAT) : null,
'meta' => $queue->getMeta(),
'task_id' => (string)$task->getId(), // (string) for BC
'newsletter_id' => ($queue->getNewsletter() instanceof NewsletterEntity) ? (string)$queue->getNewsletter()->getId() : null, // (string) for BC
'newsletter_id' => ($newsletter = $queue->getNewsletter()) ? (string)$newsletter->getId() : null, // (string) for BC
'newsletter_rendered_subject' => $queue->getNewsletterRenderedSubject(),
'count_total' => (string)$queue->getCountTotal(), // (string) for BC
'count_processed' => (string)$queue->getCountProcessed(), // (string) for BC