From 819e8f86582faeb45b817319d1c2cd2b0f195fc2 Mon Sep 17 00:00:00 2001 From: Zach Stein Date: Tue, 11 Jun 2024 11:04:29 -0400 Subject: [PATCH] Fix issue related to saving customers --- Observer/Customer/Save.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Observer/Customer/Save.php b/Observer/Customer/Save.php index 10106fd..1e205bc 100644 --- a/Observer/Customer/Save.php +++ b/Observer/Customer/Save.php @@ -54,7 +54,7 @@ public function execute(Observer $observer) 'customer_id' => $customer->getId(), 'exemption_type' => $customer->getCustomAttribute('tj_exemption_type')->getValue(), 'name' => $customer->getFirstname() . ' ' . $customer->getLastname(), - 'exempt_regions' => $this->getRegionsArray($customer->getCustomAttribute('tj_regions')->getValue()), + 'exempt_regions' => $this->getRegionsArray(($customer->getCustomAttribute('tj_regions') != null ? $customer->getCustomAttribute('tj_regions')->getValue() : null )), 'country' => null, 'state' => null, 'zip' => null, @@ -77,7 +77,7 @@ public function execute(Observer $observer) } } - $response = $this->updateTaxjar($customer->getCustomAttribute('tj_last_sync')->getValue(), $data); + $response = $this->updateTaxjar(($customer->getCustomAttribute('tj_last_sync') != null ? $customer->getCustomAttribute('tj_last_sync')->getValue() : ''), $data); if (isset($response)) { $this->logger->log('Successful API response: ' . json_encode($response), 'success');