From c64bc0e883773eb8cdd728638ba3dff9671cf9b0 Mon Sep 17 00:00:00 2001 From: Konstantin Prozorov <56936-underquak3r@users.noreply.drupalcode.org> Date: Fri, 17 Nov 2023 15:57:37 +0200 Subject: [PATCH] Issue #3391557 by k.prozorov: Error with CommerceGuys\Addressing\Zone\Zone->match(). --- .../src/Plugin/Commerce/Condition/CustomerAddressBase.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/order/src/Plugin/Commerce/Condition/CustomerAddressBase.php b/modules/order/src/Plugin/Commerce/Condition/CustomerAddressBase.php index 7a937a628..4a74967b6 100644 --- a/modules/order/src/Plugin/Commerce/Condition/CustomerAddressBase.php +++ b/modules/order/src/Plugin/Commerce/Condition/CustomerAddressBase.php @@ -73,6 +73,10 @@ abstract class CustomerAddressBase extends ConditionBase { 'label' => 'N/A', ] + $this->configuration['zone']); $address = $profile->get('address')->first(); + if (!$address) { + // The conditions can't be applied without address. + return FALSE; + } return $zone->match($address); } -- GitLab