From d1f3efbacb4a41e06d6058712d54b7f5b2d24c20 Mon Sep 17 00:00:00 2001 From: keifphos <151872458+keifphos@users.noreply.github.com> Date: Tue, 9 Jan 2024 22:43:35 +1300 Subject: [PATCH] Added null check to confirm (new) customer objects have an id before attempting to use the id. (#520) --- src/CustomerSaveManager/DefaultCustomerSaveManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CustomerSaveManager/DefaultCustomerSaveManager.php b/src/CustomerSaveManager/DefaultCustomerSaveManager.php index d82bcbd4..126603dc 100644 --- a/src/CustomerSaveManager/DefaultCustomerSaveManager.php +++ b/src/CustomerSaveManager/DefaultCustomerSaveManager.php @@ -118,7 +118,7 @@ protected function rememberOriginalCustomer(CustomerInterface $customer) } } - if (!$originalCustomerNeeded && $this->getSaveOptions()->isNewsletterQueueEnabled()) { + if (!$originalCustomerNeeded && $this->getSaveOptions()->isNewsletterQueueEnabled() && $customer->getId() != null) { $originalCustomerNeeded = true; }