Skip to content

Commit

Permalink
Add address parent check
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin- committed Dec 23, 2021
1 parent 19f36e4 commit 37a9602
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 37a9602

Please sign in to comment.