protected function fixDeliveryDefault(CustomerAddressInterface $address)
    {
        if (!$this->persistenceHelper->isChanged($address, ['deliveryDefault'])) {
            return;
        }

        $customer = $address->getCustomer();

        if ($address->isDeliveryDefault()) {
            foreach ($customer->getAddresses() as $a) {
                if ($a === $address) {
                    continue;
                }

                if ($a->isDeliveryDefault()) {
                    $a->setDeliveryDefault(false);
                    $this->persistenceHelper->persistAndRecompute($a, false);
                }
            }
        } elseif (null === $customer->getDefaultDeliveryAddress(true)) {
            $address->setDeliveryDefault(true);
            $this->persistenceHelper->persistAndRecompute($address, false);
        }
    }