diff --git a/Framework/Interaction/Tax.php b/Framework/Interaction/Tax.php index 5e8f7700..e780cf12 100644 --- a/Framework/Interaction/Tax.php +++ b/Framework/Interaction/Tax.php @@ -938,7 +938,13 @@ protected function retrieveCustomerCode($customer, $customerCode) // A method exists with this getter name, call it return $customer->{$getCustomerCode}(); } - // This was not a system-defined customer attribute, attempt to retrieve it as a custom attribute - return $customer->getCustomAttribute($customerCode)->getValue(); + // This was not a system-defined customer attribute, retrieve it as a custom attribute + $attribute = $customer->getCustomAttribute($customerCode); + if (is_null($attribute)) { + // Retrieving the custom attribute failed, or no value was set, return null + return null; + } + // Return value of custom attribute + return $attribute->getValue(); } }