From a530c95422844f034b631dd16a4c300abb83b398 Mon Sep 17 00:00:00 2001 From: John Linhart Date: Wed, 5 Dec 2018 18:13:38 +0100 Subject: [PATCH] Check that the contact exists before checking locale --- app/bundles/EmailBundle/Controller/PublicController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/bundles/EmailBundle/Controller/PublicController.php b/app/bundles/EmailBundle/Controller/PublicController.php index a6e84c21cbb..3190d5eacf3 100644 --- a/app/bundles/EmailBundle/Controller/PublicController.php +++ b/app/bundles/EmailBundle/Controller/PublicController.php @@ -334,11 +334,11 @@ public function resubscribeAction($idHash) /** @var \Mautic\LeadBundle\Model\LeadModel $leadModel */ $leadModel = $this->getModel('lead'); $leadModel->setCurrentLead($lead); - } - // Set lead lang - if ($lead->getPreferredLocale()) { - $this->translator->setLocale($lead->getPreferredLocale()); + // Set lead lang + if ($lead->getPreferredLocale()) { + $this->translator->setLocale($lead->getPreferredLocale()); + } } $model->removeDoNotContact($stat->getEmailAddress());