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));