From 37a96021b3c31808350e9938315b11a5b3a97715 Mon Sep 17 00:00:00 2001 From: Valentin Sampl Date: Thu, 23 Dec 2021 08:33:08 +0100 Subject: [PATCH] Add address parent check --- .../Component/Core/Customer/CustomerTransformHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CoreShop/Component/Core/Customer/CustomerTransformHelper.php b/src/CoreShop/Component/Core/Customer/CustomerTransformHelper.php index b87edc0634..38a0fdbf0e 100644 --- a/src/CoreShop/Component/Core/Customer/CustomerTransformHelper.php +++ b/src/CoreShop/Component/Core/Customer/CustomerTransformHelper.php @@ -126,7 +126,7 @@ public function moveAddressToNewAddressStack(AddressInterface $address, ElementI } // set new or changed parent - if ($this->isNewEntity($address) === true || $address->getParent()->getId() !== $newParent->getId()) { + if ($this->isNewEntity($address) === true || ($address->getParent() && $address->getParent()->getId() !== $newParent->getId())) { $address->setParent($newParent); $address->setKey($this->getSaveKeyForMoving($address, $newParent));